mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
drivers/timers/oneshot.c: Support signal notification through SIGEV_THREAD
drivers/timers/rtc.c: Support signal notification through SIGEV_THREAD drivers/input/ajoystick.c: Support signal notification through SIGEV_THREAD drivers/input/djoystick.c: Support signal notification through SIGEV_THREAD drivers/input/button_upper.c: Support signal notification through SIGEV_THREAD drivers/sensors/zerocross.c: Support signal notification through SIGEV_THREAD drivers/wireless/ieee802154: Support signal notification through SIGEV_THREAD drivers/lcd/ft80x.c: Support signal notification through SIGEV_THREAD
This commit is contained in:
@@ -120,8 +120,8 @@ struct mac802154_chardevice_s
|
||||
/* MAC Service notification information */
|
||||
|
||||
bool md_notify_registered;
|
||||
uint8_t md_notify_signo;
|
||||
pid_t md_notify_pid;
|
||||
struct sigevent md_notify_event;
|
||||
|
||||
#endif
|
||||
};
|
||||
@@ -624,7 +624,7 @@ static int mac802154dev_ioctl(FAR struct file *filep, int cmd,
|
||||
{
|
||||
/* Save the notification events */
|
||||
|
||||
dev->md_notify_signo = macarg->signo;
|
||||
dev->md_notify_event = macarg->event;
|
||||
dev->md_notify_pid = getpid();
|
||||
dev->md_notify_registered = true;
|
||||
|
||||
@@ -766,16 +766,9 @@ static int mac802154dev_notify(FAR struct mac802154_maccb_s *maccb,
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
if (dev->md_notify_registered)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
union sigval value;
|
||||
value.sival_int = (int)primitive->type;
|
||||
(void)nxsig_queue(dev->md_notify_pid, dev->md_notify_signo,
|
||||
value);
|
||||
#else
|
||||
(void)nxsig_queue(dev->md_notify_pid, dev->md_notify_signo,
|
||||
(FAR void *)primitive->type);
|
||||
#endif
|
||||
dev->md_notify_event.sigev_value.sival_int = primitive->type;
|
||||
nxsig_notification(dev->md_notify_pid, &dev->md_notify_event,
|
||||
SI_QUEUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ struct macnet_driver_s
|
||||
/* MAC Service notification information */
|
||||
|
||||
bool md_notify_registered;
|
||||
uint8_t md_notify_signo;
|
||||
pid_t md_notify_pid;
|
||||
struct sigevent md_notify_event;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -444,15 +444,9 @@ static int macnet_notify(FAR struct mac802154_maccb_s *maccb,
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
if (priv->md_notify_registered)
|
||||
{
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
union sigval value;
|
||||
value.sival_int = (int)primitive->type;
|
||||
(void)nxsig_queue(priv->md_notify_pid, priv->md_notify_signo,
|
||||
value);
|
||||
#else
|
||||
(void)nxsig_queue(priv->md_notify_pid, priv->md_notify_signo,
|
||||
(FAR void *)primitive->type);
|
||||
#endif
|
||||
priv->md_notify_event.sigev_value.sival_int = primitive->type;
|
||||
nxsig_notification(priv->md_notify_pid, &priv->md_notify_event,
|
||||
SI_QUEUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1053,7 +1047,7 @@ static int macnet_ioctl(FAR struct net_driver_s *dev, int cmd,
|
||||
{
|
||||
/* Save the notification events */
|
||||
|
||||
priv->md_notify_signo = netmac->u.signo;
|
||||
priv->md_notify_event = netmac->u.event;
|
||||
priv->md_notify_pid = getpid();
|
||||
priv->md_notify_registered = true;
|
||||
ret = OK;
|
||||
|
||||
Reference in New Issue
Block a user