author | zecke <zecke> | 2005-10-06 18:58:40 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-10-06 18:58:40 (UTC) |
commit | 0bad2116a1ceed19956b94889cb034781f35146d (patch) (side-by-side diff) | |
tree | a1131b9e026cdf5533c4da6a7f49fcbb139b4e09 | |
parent | 31777172abf127e00594790e4365dfad8772b100 (diff) | |
download | opie-0bad2116a1ceed19956b94889cb034781f35146d.zip opie-0bad2116a1ceed19956b94889cb034781f35146d.tar.gz opie-0bad2116a1ceed19956b94889cb034781f35146d.tar.bz2 |
ODevice patch from #1701 gor hp1940
-Allocate device number
-Some implementation
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 492c97b..c70d2af 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h @@ -56,32 +56,33 @@ class ODeviceData; enum OModel { Model_Unknown, // = 0 Model_Series_Mask = 0xffff0000, Model_iPAQ = ( 1 << 16 ), Model_iPAQ_All = ( Model_iPAQ | 0xffff ), Model_iPAQ_H31xx = ( Model_iPAQ | 0x0001 ), Model_iPAQ_H36xx = ( Model_iPAQ | 0x0002 ), Model_iPAQ_H37xx = ( Model_iPAQ | 0x0003 ), Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), + Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), Model_Jornada = ( 6 << 16 ), Model_Jornada_56x = ( Model_Jornada | 0x0001 ), Model_Jornada_720 = ( Model_Jornada | 0x0002 ), Model_Zaurus = ( 2 << 16 ), Model_Zaurus_SL5000 = ( Model_Zaurus | 0x0001 ), Model_Zaurus_SL5500 = ( Model_Zaurus | 0x0002 ), Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), Model_Zaurus_SL6000 = ( Model_Zaurus | 0x0006 ), Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x0007 ), Model_Zaurus_SLC1000 = ( Model_Zaurus | 0x0008 ), Model_Zaurus_SLC3100 = ( Model_Zaurus | 0x0009 ), diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 3cc6cec..52da2d9 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp @@ -138,43 +138,46 @@ void iPAQ::init(const QString& model) if ( d->m_modelstr == "H3100" ) d->m_model = Model_iPAQ_H31xx; else if ( d->m_modelstr == "H3600" ) d->m_model = Model_iPAQ_H36xx; else if ( d->m_modelstr == "H3700" ) d->m_model = Model_iPAQ_H37xx; else if ( d->m_modelstr == "H3800" ) d->m_model = Model_iPAQ_H38xx; else if ( d->m_modelstr == "H3900" ) d->m_model = Model_iPAQ_H39xx; else if ( d->m_modelstr == "H5400" ) d->m_model = Model_iPAQ_H5xxx; else if ( d->m_modelstr == "H2200" ) d->m_model = Model_iPAQ_H22xx; else if ( d->m_modelstr == "H1910" ) d->m_model = Model_iPAQ_H191x; + else if ( d->m_modelstr == "H1940" ) + d->m_model = Model_iPAQ_H1940; else d->m_model = Model_Unknown; switch ( d->m_model ) { case Model_iPAQ_H31xx: case Model_iPAQ_H38xx: d->m_rotation = Rot90; break; case Model_iPAQ_H5xxx: case Model_iPAQ_H22xx: case Model_iPAQ_H191x: + case Model_iPAQ_H1940: d->m_rotation = Rot0; break; case Model_iPAQ_H36xx: case Model_iPAQ_H37xx: case Model_iPAQ_H39xx: default: d->m_rotation = Rot270; break; } m_leds [0] = m_leds [1] = Led_Off; m_power_timer = 0; } @@ -287,33 +290,34 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b } // Rotate cursor keys 180 or 270 case Key_Left : case Key_Right: case Key_Up : case Key_Down : { if (( d->m_model == Model_iPAQ_H31xx ) || ( d->m_model == Model_iPAQ_H38xx )) { newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; } // Rotate the cursor keys by 270 // keycode - Key_Left = position of the button starting from left clockwise // add the rotation to it and modolo. No we've the original offset // add the offset to the Key_Left key if (( d->m_model == Model_iPAQ_H5xxx ) || - ( d->m_model == Model_iPAQ_H191x )) + ( d->m_model == Model_iPAQ_H191x ) || + ( d->m_model == Model_iPAQ_H1940 )) newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; break; } // map Power Button short/long press to F34/F35 case Key_SysReq: { if ( isPress ) { if ( m_power_timer ) killTimer ( m_power_timer ); m_power_timer = startTimer ( 500 ); } else if ( m_power_timer ) { killTimer ( m_power_timer ); m_power_timer = 0; QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); @@ -389,32 +393,34 @@ bool iPAQ::setDisplayBrightness ( int bright ) int iPAQ::displayBrightnessResolution() const { switch ( model()) { case Model_iPAQ_H31xx: case Model_iPAQ_H36xx: case Model_iPAQ_H37xx: return 128; // really 256, but >128 could damage the LCD case Model_iPAQ_H38xx: case Model_iPAQ_H39xx: return 64; case Model_iPAQ_H5xxx: return 255; case Model_iPAQ_H191x: return 183; + case Model_iPAQ_H191x: + return 44; default: return 2; } } bool iPAQ::setDisplayStatus ( bool on ) { bool res = false; QString cmdline; if ( model() == Model_iPAQ_H191x ) { cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/pxafb/power; echo %2 > /sys/class/backlight/pxafb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); } else { return OAbstractMobileDevice::setDisplayStatus(on); } |