Follow up the kernel signal-related change in:
examples/oneshot/oneshot_main.c: examples/alarm/alarm_main.c: examples/ajoystick/ajoy_main.c examples/djoystick/djoy_main.c examples/buttons/buttons_main.c examples/zerocross/zerocross_main.c graphics/traveler/src/trv_input.c graphics/ft80x/
This commit is contained in:
parent
2771205bc3
commit
ff54c47e64
@ -420,7 +420,9 @@ int ajoy_main(int argc, char *argv[])
|
||||
|
||||
notify.an_press = g_ajoysupported;
|
||||
notify.an_release = g_ajoysupported;
|
||||
notify.an_signo = CONFIG_EXAMPLES_AJOYSTICK_SIGNO;
|
||||
|
||||
notify.an_event.sigev_notify = SIGEV_SIGNAL;
|
||||
notify.an_event.sigev_signo = CONFIG_EXAMPLES_AJOYSTICK_SIGNO;
|
||||
|
||||
ret = ioctl(fd, AJOYIOC_REGISTER, (unsigned long)((uintptr_t)¬ify));
|
||||
if (ret < 0)
|
||||
|
@ -398,11 +398,12 @@ int alarm_main(int argc, FAR char *argv[])
|
||||
/* Set the alarm */
|
||||
|
||||
setrel.id = alarmid;
|
||||
setrel.signo = CONFIG_EXAMPLES_ALARM_SIGNO;
|
||||
setrel.pid = g_alarm_daemon_pid;
|
||||
setrel.reltime = (time_t)seconds;
|
||||
|
||||
setrel.sigvalue.sival_int = alarmid;
|
||||
setrel.event.sigev_notify = SIGEV_SIGNAL;
|
||||
setrel.event.sigev_signo = CONFIG_EXAMPLES_ALARM_SIGNO;
|
||||
setrel.event.sigev_value.sival_int = alarmid;
|
||||
|
||||
ret = ioctl(fd, RTC_SET_RELATIVE, (unsigned long)((uintptr_t)&setrel));
|
||||
if (ret < 0)
|
||||
|
@ -224,7 +224,9 @@ static int button_daemon(int argc, char *argv[])
|
||||
|
||||
btnevents.bn_press = supported;
|
||||
btnevents.bn_release = supported;
|
||||
btnevents.bn_signo = CONFIG_EXAMPLES_BUTTONS_SIGNO;
|
||||
|
||||
btnevents.bn_event.sigev_notify = SIGEV_SIGNAL;
|
||||
btnevents.bn_event.sigev_signo = CONFIG_EXAMPLES_BUTTONS_SIGNO;
|
||||
|
||||
/* Register to receive a signal when buttons are pressed/released */
|
||||
|
||||
|
@ -183,7 +183,9 @@ int djoy_main(int argc, char *argv[])
|
||||
|
||||
notify.dn_press = g_djoysupported;
|
||||
notify.dn_release = g_djoysupported;
|
||||
notify.dn_signo = CONFIG_EXAMPLES_DJOYSTICK_SIGNO;
|
||||
|
||||
notify.dn_event.sigev_notify = SIGEV_SIGNAL;
|
||||
notify.dn_event.sigev_signo = CONFIG_EXAMPLES_DJOYSTICK_SIGNO;
|
||||
|
||||
ret = ioctl(fd, DJOYIOC_REGISTER, (unsigned long)((uintptr_t)¬ify));
|
||||
if (ret < 0)
|
||||
|
@ -202,8 +202,6 @@ int oneshot_main(int argc, char *argv[])
|
||||
usecs);
|
||||
|
||||
start.pid = 0;
|
||||
start.signo = CONFIG_EXAMPLES_ONESHOT_SIGNO;
|
||||
start.arg = NULL;
|
||||
|
||||
secs = usecs / 1000000;
|
||||
usecs -= 1000000 * secs;
|
||||
@ -211,6 +209,10 @@ int oneshot_main(int argc, char *argv[])
|
||||
start.ts.tv_sec = secs;
|
||||
start.ts.tv_nsec = usecs * 1000;
|
||||
|
||||
start.event.sigev_notify = SIGEV_SIGNAL;
|
||||
start.event.sigev_signo = CONFIG_EXAMPLES_ONESHOT_SIGNO;
|
||||
start.event.sigev_value.sival_ptr = NULL;
|
||||
|
||||
/* Zero usecs to terminate the loop */
|
||||
|
||||
usecs = 0;
|
||||
|
@ -209,9 +209,11 @@ int timer_main(int argc, char *argv[])
|
||||
|
||||
printf("Attach timer handler\n");
|
||||
|
||||
notify.arg = NULL;
|
||||
notify.pid = getpid();
|
||||
notify.signo = CONFIG_EXAMPLES_TIMER_SIGNO;
|
||||
|
||||
notify.event.sigev_notify = SIGEV_SIGNAL;
|
||||
notify.event.sigev_signo = CONFIG_EXAMPLES_TIMER_SIGNO;
|
||||
notify.event.sigev_value.sival_ptr = NULL;
|
||||
|
||||
ret = ioctl(fd, TCIOC_NOTIFICATION, (unsigned long)((uintptr_t)¬ify));
|
||||
if (ret < 0)
|
||||
|
@ -88,7 +88,7 @@ int main(int argc, FAR char *argv[])
|
||||
int zerocross_main(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
struct zc_notify_s notify;
|
||||
struct sigevent event;
|
||||
int fd;
|
||||
int tmp;
|
||||
int ret;
|
||||
@ -106,9 +106,10 @@ int zerocross_main(int argc, char *argv[])
|
||||
|
||||
/* Register to receive a signal on every zero cross event */
|
||||
|
||||
notify.zc_signo = CONFIG_EXAMPLES_ZEROCROSS_SIGNO;
|
||||
event.sigev_notify = SIGEV_SIGNAL;
|
||||
event.sigev_signo = CONFIG_EXAMPLES_ZEROCROSS_SIGNO;
|
||||
|
||||
ret = ioctl(fd, ZCIOC_REGISTER, (unsigned long)((uintptr_t)¬ify));
|
||||
ret = ioctl(fd, ZCIOC_REGISTER, (unsigned long)((uintptr_t)&event));
|
||||
if (ret < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: ioctl(ZCIOC_REGISTER) failed: %d\n", errno);
|
||||
|
@ -276,9 +276,11 @@ int ft80x_ramcmd_waitfifoempty(int fd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
notify.signo = CONFIG_GRAPHICS_FT80X_CMDEMPTY_SIGNAL;
|
||||
notify.event.sigev_notify = SIGEV_SIGNAL;
|
||||
notify.event.sigev_signo = CONFIG_GRAPHICS_FT80X_CMDEMPTY_SIGNAL;
|
||||
|
||||
notify.pid = getpid();
|
||||
notify.event = FT80X_NOTIFY_CMDEMPTY;
|
||||
notify.id = FT80X_NOTIFY_CMDEMPTY;
|
||||
notify.enable = false;
|
||||
|
||||
for (; ; )
|
||||
|
@ -179,9 +179,11 @@ int ft80x_touch_waittag(int fd, uint8_t oldtag)
|
||||
return ret;
|
||||
}
|
||||
|
||||
notify.signo = CONFIG_GRAPHICS_FT80X_TAG_SIGNAL;
|
||||
notify.event.sigev_notify = SIGEV_SIGNAL;
|
||||
notify.event.sigev_signo = CONFIG_GRAPHICS_FT80X_TAG_SIGNAL;
|
||||
|
||||
notify.pid = getpid();
|
||||
notify.event = FT80X_NOTIFY_TAG;
|
||||
notify.id = FT80X_NOTIFY_TAG;
|
||||
notify.enable = false;
|
||||
|
||||
for (; ; )
|
||||
|
@ -485,7 +485,9 @@ void trv_input_initialize(void)
|
||||
|
||||
notify.an_press = BUTTON_SET;
|
||||
notify.an_release = 0;
|
||||
notify.an_signo = CONFIG_GRAPHICS_TRAVELER_JOYSTICK_SIGNO;
|
||||
|
||||
notify.an_event.sigev_notify = SIGEV_SIGNAL;
|
||||
notify.an_event.sigev_signo = CONFIG_GRAPHICS_TRAVELER_JOYSTICK_SIGNO;
|
||||
|
||||
ret = ioctl(g_trv_joystick.fd, AJOYIOC_REGISTER, (unsigned long)((uintptr_t)¬ify));
|
||||
if (ret < 0)
|
||||
@ -507,7 +509,9 @@ void trv_input_initialize(void)
|
||||
|
||||
notify.an_press = 0;
|
||||
notify.an_release = 0;
|
||||
notify.an_signo = CONFIG_GRAPHICS_TRAVELER_JOYSTICK_SIGNO;
|
||||
|
||||
notify.an_event.sigev_notify = SIGEV_SIGNAL;
|
||||
notify.an_event.sigev_signo = CONFIG_GRAPHICS_TRAVELER_JOYSTICK_SIGNO;
|
||||
|
||||
ret = ioctl(g_trv_joystick.fd, AJOYIOC_REGISTER, (unsigned long)((uintptr_t)¬ify));
|
||||
if (ret < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user