-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 33 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 2 |
2 files changed, 10 insertions, 25 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index d3ab63a..b22ee70 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -548,14 +548,6 @@ Transformation Zaurus::rotation() const | |||
548 | case Model_Zaurus_SLC7x0: | 548 | case Model_Zaurus_SLC7x0: |
549 | handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); | 549 | OHingeStatus hs = readHingeSensor(); |
550 | if (handle == -1) { | 550 | if ( hs == CASE_PORTRAIT ) rot = Rot0; |
551 | return Rot270; | 551 | else if ( hs == CASE_UNKNOWN ) rot = Rot0; |
552 | } else { | 552 | else rot = Rot270; |
553 | retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION); | ||
554 | ::close (handle); | ||
555 | |||
556 | if (retval == 2 ) | ||
557 | rot = Rot0; | ||
558 | else | ||
559 | rot = Rot270; | ||
560 | } | ||
561 | break; | 553 | break; |
@@ -581,13 +573,6 @@ ODirection Zaurus::direction() const | |||
581 | case Model_Zaurus_SLC7x0: | 573 | case Model_Zaurus_SLC7x0: |
582 | handle = ::open( "/dev/apm_bios", O_RDWR|O_NONBLOCK ); | 574 | OHingeStatus hs = readHingeSensor(); |
583 | if (handle == -1) { | 575 | if ( hs == CASE_PORTRAIT ) dir = CCW; |
584 | dir = CW; | 576 | else if ( hs == CASE_UNKNOWN ) dir = CCW; |
585 | } else { | 577 | else dir = CW; |
586 | retval = ::ioctl( handle, SHARP_IOCTL_GET_ROTATION ); | ||
587 | ::close (handle); | ||
588 | if (retval == 2 ) | ||
589 | dir = CCW; | ||
590 | else | ||
591 | dir = CW; | ||
592 | } | ||
593 | break; | 578 | break; |
@@ -610,3 +595,3 @@ bool Zaurus::hasHingeSensor() const | |||
610 | 595 | ||
611 | OHingeStatus Zaurus::readHingeSensor() | 596 | OHingeStatus Zaurus::readHingeSensor() const |
612 | { | 597 | { |
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index ed9cf67..c763798 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h | |||
@@ -112,3 +112,3 @@ class Zaurus : public ODevice | |||
112 | virtual bool hasHingeSensor() const; | 112 | virtual bool hasHingeSensor() const; |
113 | virtual OHingeStatus readHingeSensor(); | 113 | virtual OHingeStatus readHingeSensor() const; |
114 | 114 | ||