-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_motorola_ezx.cpp | 55 |
2 files changed, 12 insertions, 44 deletions
@@ -7,6 +7,7 @@ | |||
7 | Fixed Bugs | 7 | Fixed Bugs |
8 | ---------- | 8 | ---------- |
9 | * n.a.- Improved iPAQ support in ODevice and low-level applets (Slavek Banko) | 9 | * n.a.- Improved iPAQ support in ODevice and low-level applets (Slavek Banko) |
10 | * n.a. - Improved platform support for the Motorola EZX platform (mickeyl) | ||
10 | 11 | ||
11 | Internal | 12 | Internal |
12 | -------- | 13 | -------- |
diff --git a/libopie2/opiecore/device/odevice_motorola_ezx.cpp b/libopie2/opiecore/device/odevice_motorola_ezx.cpp index 69256dd..eed81ac 100644 --- a/libopie2/opiecore/device/odevice_motorola_ezx.cpp +++ b/libopie2/opiecore/device/odevice_motorola_ezx.cpp | |||
@@ -216,34 +216,15 @@ bool Motorola_EZX::setLedState( OLed which, OLedState st ) | |||
216 | 216 | ||
217 | int Motorola_EZX::displayBrightnessResolution() const | 217 | int Motorola_EZX::displayBrightnessResolution() const |
218 | { | 218 | { |
219 | // Currently not supported | ||
220 | qDebug( "Motorola_EZX::displayBrightnessResolution: ODevice handling not yet implemented" ); | ||
221 | return 100; | ||
222 | |||
223 | #if 0 | ||
224 | int res = 1; | 219 | int res = 1; |
225 | if (m_embedix) | 220 | int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK ); |
226 | { | 221 | if ( fd ) |
227 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK ); | ||
228 | if ( fd ) | ||
229 | { | ||
230 | int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 ); | ||
231 | ::close( fd ); | ||
232 | return value ? value : res; | ||
233 | } | ||
234 | } | ||
235 | else | ||
236 | { | 222 | { |
237 | int fd = ::open( m_backlightdev + "max_brightness", O_RDONLY|O_NONBLOCK ); | 223 | char buf[100]; |
238 | if ( fd ) | 224 | if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res ); |
239 | { | 225 | ::close( fd ); |
240 | char buf[100]; | ||
241 | if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res ); | ||
242 | ::close( fd ); | ||
243 | } | ||
244 | } | 226 | } |
245 | return res; | 227 | return res; |
246 | #endif | ||
247 | } | 228 | } |
248 | 229 | ||
249 | bool Motorola_EZX::setDisplayBrightness( int bright ) | 230 | bool Motorola_EZX::setDisplayBrightness( int bright ) |
@@ -251,7 +232,6 @@ bool Motorola_EZX::setDisplayBrightness( int bright ) | |||
251 | qDebug( "Motorola_EZX::setDisplayBrightness( %d )", bright ); | 232 | qDebug( "Motorola_EZX::setDisplayBrightness( %d )", bright ); |
252 | return false; | 233 | return false; |
253 | 234 | ||
254 | #if 0 | ||
255 | bool res = false; | 235 | bool res = false; |
256 | 236 | ||
257 | if ( bright > 255 ) bright = 255; | 237 | if ( bright > 255 ) bright = 255; |
@@ -260,28 +240,15 @@ bool Motorola_EZX::setDisplayBrightness( int bright ) | |||
260 | int numberOfSteps = displayBrightnessResolution(); | 240 | int numberOfSteps = displayBrightnessResolution(); |
261 | int val = ( bright == 1 ) ? 1 : ( bright * numberOfSteps ) / 255; | 241 | int val = ( bright == 1 ) ? 1 : ( bright * numberOfSteps ) / 255; |
262 | 242 | ||
263 | if ( m_embedix ) | 243 | int fd = ::open( m_backlightdev + "brightness", O_WRONLY|O_NONBLOCK ); |
264 | { | 244 | if ( fd ) |
265 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); | ||
266 | if ( fd ) | ||
267 | { | ||
268 | res = ( ::ioctl( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 ); | ||
269 | ::close( fd ); | ||
270 | } | ||
271 | } | ||
272 | else | ||
273 | { | 245 | { |
274 | int fd = ::open( m_backlightdev + "brightness", O_WRONLY|O_NONBLOCK ); | 246 | char buf[100]; |
275 | if ( fd ) | 247 | int len = ::snprintf( &buf[0], sizeof buf, "%d", val ); |
276 | { | 248 | res = ( ::write( fd, &buf[0], len ) == 0 ); |
277 | char buf[100]; | 249 | ::close( fd ); |
278 | int len = ::snprintf( &buf[0], sizeof buf, "%d", val ); | ||
279 | res = ( ::write( fd, &buf[0], len ) == 0 ); | ||
280 | ::close( fd ); | ||
281 | } | ||
282 | } | 250 | } |
283 | return res; | 251 | return res; |
284 | #endif | ||
285 | } | 252 | } |
286 | 253 | ||
287 | bool Motorola_EZX::setDisplayStatus( bool on ) | 254 | bool Motorola_EZX::setDisplayStatus( bool on ) |