summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp6
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
@@ -1106,52 +1106,54 @@ void Zaurus::initButtons ( )
#define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1)
typedef struct sharp_led_status {
int which; /* select which LED status is wanted. */
int status; /* set new led status if you call SHARP_LED_SETSTATUS */
} sharp_led_status;
#define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */
#define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */
#define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */
#define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */
// #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 );
}
void Zaurus::keySound ( )
{
buzzer ( SHARP_BUZ_KEYSOUND );
}
QValueList <OLed> Zaurus::ledList ( ) const
{
QValueList <OLed> vl;
vl << Led_Mail;
return vl;