author | kergoth <kergoth> | 2003-04-01 20:33:39 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-04-01 20:33:39 (UTC) |
commit | 76b83c2b77e626fadf1d1bbbfd19a9a8a795334b (patch) (side-by-side diff) | |
tree | 02d425c7e185842d0a12d9fe3d0b6377005fed67 | |
parent | a7ad29eb41163eec88b3bd835108bd80140ff086 (diff) | |
download | opie-76b83c2b77e626fadf1d1bbbfd19a9a8a795334b.zip opie-76b83c2b77e626fadf1d1bbbfd19a9a8a795334b.tar.gz opie-76b83c2b77e626fadf1d1bbbfd19a9a8a795334b.tar.bz2 |
Open zaurus buzzer device as write only, and close it.
-rw-r--r-- | libopie/odevice.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 55ba7bd..cea4f35 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -1118,28 +1118,30 @@ typedef struct sharp_led_status { // #include <asm/sharp_apm.h> // including kernel headers is evil ... #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) #define APM_EVT_POWER_BUTTON (1 << 0) #define FL_IOCTL_STEP_CONTRAST 100 void Zaurus::buzzer ( int sound ) { - static int fd = ::open ( "/dev/sharp_buz", O_RDWR|O_NONBLOCK ); + static int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); - if ( fd >= 0 ) + if ( fd >= 0 ) { ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); + ::close ( fd ); + } } void Zaurus::alarmSound ( ) { buzzer ( SHARP_BUZ_SCHEDULE_ALARM ); } void Zaurus::touchSound ( ) { buzzer ( SHARP_BUZ_TOUCHSOUND ); } |