summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index 2e54216..d6c2c80 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -209,49 +209,49 @@ void SIMpad::initButtons()
* via a proc filesystem file. Using this register
* one can toggle power of serial, irda, dect circuits
* change the video driver and display status and
* many more things.
* To not lose the current setting we read the current
* cs3 setting and toggle the necessary bits and then
* write it.
*/
static bool setCS3Bit( bool bitset, int bit ) {
QFile file( SIMPAD_BOARDCONTROL );
if ( !file.open( IO_ReadOnly ) )
return false;
unsigned int val = 0;
bool ok = false;
QTextStream stream( &file );
/*
* Use QFile and QTextStream for parsing to be more
* robust
*/
while ( !stream.atEnd() ) {
QString line = stream.readLine();
if ( line.startsWith( "Chipselect3 : " ) ) {
- val = line.mid( 15 ).toUInt( 0, 16 );
+ val = line.mid( 14 ).toUInt( 0, 16 );
ok = true;
break;
}
}
if ( !ok )
return false;
file.close();
/*
* change the value
*/
val = bitset ? (val | bit) : (val & ~bit);
/*
* write it back
*/
int cs3_fd = ::open( SIMPAD_BOARDCONTROL, O_WRONLY );
if ( cs3_fd < 0 )
return false;
char line[32];
::snprintf(line, sizeof(line), "0x%04x\n", val);