summaryrefslogtreecommitdiff
path: root/library/custom-sharp.h
authorllornkcor <llornkcor>2002-04-24 19:37:47 (UTC)
committer llornkcor <llornkcor>2002-04-24 19:37:47 (UTC)
commitfeaa245515b0746f6f70f590411c38e0a54c88ee (patch) (unidiff)
tree352ab6e61ea8e773d9f08f77db0ca36984c62c1d /library/custom-sharp.h
parent17eb865ad8248b1f47c565b074b9b6bbbd44935b (diff)
downloadopie-feaa245515b0746f6f70f590411c38e0a54c88ee.zip
opie-feaa245515b0746f6f70f590411c38e0a54c88ee.tar.gz
opie-feaa245515b0746f6f70f590411c38e0a54c88ee.tar.bz2
enable keyclicks and touchsound on zaurus
Diffstat (limited to 'library/custom-sharp.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/custom-sharp.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/library/custom-sharp.h b/library/custom-sharp.h
index f65d474..08f8a6f 100644
--- a/library/custom-sharp.h
+++ b/library/custom-sharp.h
@@ -40,5 +40,5 @@
40 40
41/* --- for SHARP_BUZZER device --- */ 41/* --- for SHARP_BUZZER device --- */
42 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 42#define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
43#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) 43#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START)
44#define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) 44#define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1)
@@ -71,4 +71,7 @@
71 71
72#define CUSTOM_SOUND_ALARM CUSTOM_BUZZER( SHARP_BUZ_SCHEDULE_ALARM ) 72#define CUSTOM_SOUND_ALARM CUSTOM_BUZZER( SHARP_BUZ_SCHEDULE_ALARM )
73#define CUSTOM_SOUND_KEYCLICK CUSTOM_BUZZER( SHARP_BUZ_KEYSOUND )
74#define CUSTOM_SOUND_TOUCH CUSTOM_BUZZER( SHARP_BUZ_TOUCHSOUND )
75
73 76
74#include <sys/ioctl.h> 77#include <sys/ioctl.h>
@@ -98,12 +101,12 @@ static void sig_handler(int sig) \
98 switch (sig) { \ 101 switch (sig) { \
99 case SIGHUP: \ 102 case SIGHUP: \
100 memstate = VeryLow; \ 103 memstate = VeryLow; \
101 break; \ 104 break; \
102 case SIGUSR1: \ 105 case SIGUSR1: \
103 memstate = Normal; \ 106 memstate = Normal; \
104 break; \ 107 break; \
105 case SIGUSR2: \ 108 case SIGUSR2: \
106 memstate = Low; \ 109 memstate = Low; \
107 break; \ 110 break; \
108 } \ 111 } \
109} \ 112} \
@@ -115,11 +118,11 @@ static void initMemalerter() \
115 sa.sa_flags = SA_RESTART; \ 118 sa.sa_flags = SA_RESTART; \
116 if (sigaction(SIGHUP, &sa, NULL) < 0) { \ 119 if (sigaction(SIGHUP, &sa, NULL) < 0) { \
117 return; \ 120 return; \
118 } \ 121 } \
119 if (sigaction(SIGUSR1, &sa, NULL) < 0) { \ 122 if (sigaction(SIGUSR1, &sa, NULL) < 0) { \
120 return; \ 123 return; \
121 } \ 124 } \
122 if (sigaction(SIGUSR2, &sa, NULL) < 0) { \ 125 if (sigaction(SIGUSR2, &sa, NULL) < 0) { \
123 return; \ 126 return; \
124 } \ 127 } \
125 FILE *fo = fopen("/proc/sys/vm/freepg_signal_proc", "w"); \ 128 FILE *fo = fopen("/proc/sys/vm/freepg_signal_proc", "w"); \
@@ -137,10 +140,10 @@ static void initMemalerter() \
137 int dev = ::open("/dev/sharp_kbdctl", O_RDWR); \ 140 int dev = ::open("/dev/sharp_kbdctl", O_RDWR); \
138 if( dev >= 0 ) { \ 141 if( dev >= 0 ) { \
139 memset(&st, 0, sizeof(st)); \ 142 memset(&st, 0, sizeof(st)); \
140 st.which = 3; \ 143 st.which = 3; \
141 int ret = ioctl(dev, SHARP_KBDCTL_GETMODIFSTAT, (char*)&st); \ 144 int ret = ioctl(dev, SHARP_KBDCTL_GETMODIFSTAT, (char*)&st); \
142 if( !ret ) \ 145 if( !ret ) \
143 numLock = (bool)st.stat; \ 146 numLock = (bool)st.stat; \
144 ::close(dev); \ 147 ::close(dev); \
145 } \ 148 } \
146 return numLock; \ 149 return numLock; \