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:
Xiang Xiao
2019-01-27 08:53:12 -06:00
committed by Gregory Nutt
parent 7dd81cc5c2
commit 5e8ae23edc
19 changed files with 124 additions and 200 deletions
+3 -1
View File
@@ -58,6 +58,8 @@
#include <nuttx/config.h>
#include <nuttx/input/ioctl.h>
#include <signal.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -187,7 +189,7 @@ struct ajoy_notify_s
{
ajoy_buttonset_t an_press; /* Set of button depressions to be notified */
ajoy_buttonset_t an_release; /* Set of button releases to be notified */
uint8_t an_signo; /* Signal number to use in the notification */
struct sigevent an_event; /* Describe the way a task is to be notified */
};
/* This structure is returned by read() and provides the sample state of the
+3 -1
View File
@@ -43,6 +43,8 @@
#include <nuttx/config.h>
#include <nuttx/fs/ioctl.h>
#include <signal.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -118,7 +120,7 @@ struct btn_notify_s
{
btn_buttonset_t bn_press; /* Set of button depressions to be notified */
btn_buttonset_t bn_release; /* Set of button releases to be notified */
uint8_t bn_signo; /* Signal number to use in the notification */
struct sigevent bn_event; /* Describe the way a task is to be notified */
};
/* This is the type of the button interrupt handler used with the struct
+3 -1
View File
@@ -58,6 +58,8 @@
#include <nuttx/config.h>
#include <nuttx/input/ioctl.h>
#include <signal.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -186,7 +188,7 @@ struct djoy_notify_s
{
djoy_buttonset_t dn_press; /* Set of button depressions to be notified */
djoy_buttonset_t dn_release; /* Set of button releases to be notified */
uint8_t dn_signo; /* Signal number to use in the notification */
struct sigevent dn_event; /* Describe the way a task is to be notified */
};
/* This is the type of the discrete joystick interrupt handler used with
+4 -2
View File
@@ -58,6 +58,8 @@
#include <nuttx/i2c/i2c_master.h>
#include <nuttx/lcd/lcd_ioctl.h>
#include <signal.h>
#ifdef CONFIG_LCD_FT80X
/********************************************************************************************
@@ -1636,9 +1638,9 @@ enum ft80x_notify_e
struct ft80x_notify_s
{
int signo; /* Notify using this signal number */
pid_t pid; /* Send the notification to this task */
enum ft80x_notify_e event; /* Notify on this event */
enum ft80x_notify_e id; /* Notify on this event */
struct sigevent event; /* Describe the way a task is to be notified */
bool enable; /* True: enable notification; false: disable */
};
+3 -11
View File
@@ -43,6 +43,8 @@
#include <nuttx/config.h>
#include <nuttx/fs/ioctl.h>
#include <signal.h>
#ifdef CONFIG_SENSORS_ZEROCROSS
/****************************************************************************
@@ -56,7 +58,7 @@
/* Command: ZCIOC_REGISTER
* Description: Register to receive a signal whenever there is zero cross
* interrupt event.
* Argument: A read-only pointer to an instance of struct zc_notify_s
* Argument: A read-only pointer to an instance of struct sigevent
* Return: Zero (OK) on success. Minus one will be returned on failure
* with the errno value set appropriately.
*/
@@ -91,16 +93,6 @@ typedef CODE void (*zc_interrupt_t)
* fields of the following generic lower half state structure.
*/
/* A reference to this structure is provided with the ZCIOC_REGISTER IOCTL
* command and describes the conditions under which the client would like
* to receive notification.
*/
struct zc_notify_s
{
uint8_t zc_signo; /* Signal number to use in the notification */
};
struct zc_lowerhalf_s
{
/* Enable interrupt on the defined pin used to zero cross detection */
+4 -4
View File
@@ -43,6 +43,7 @@
#include <nuttx/config.h>
#include <errno.h>
#include <signal.h>
#include <stdint.h>
#include <time.h>
@@ -223,10 +224,9 @@ struct oneshot_lowerhalf_s
struct oneshot_start_s
{
pid_t pid; /* PID of task to be signalled (0 means calling task) */
int signo; /* Signal number to use */
FAR void *arg; /* Signal value argument */
struct timespec ts; /* Delay until time expiration */
pid_t pid; /* PID of task to be signalled (0 means calling task) */
struct sigevent event; /* Describe the way a task is to be notified */
struct timespec ts; /* Delay until time expiration */
};
#endif
+3 -6
View File
@@ -262,9 +262,8 @@ struct rtc_rdalarm_s
struct rtc_setalarm_s
{
uint8_t id; /* Indicates the alarm to be set */
uint8_t signo; /* Signal number for alarm notification */
pid_t pid; /* Identifies task to be notified (0=caller) */
union sigval sigvalue; /* Data passed with notification */
struct sigevent event; /* Describe the way a task is to be notified */
struct rtc_time time; /* Alarm time */
};
@@ -273,9 +272,8 @@ struct rtc_setalarm_s
struct rtc_setrelative_s
{
uint8_t id; /* Indicates the alarm to be set */
uint8_t signo; /* Signal number for alarm notification */
pid_t pid; /* Identifies task to be notified (0=caller) */
union sigval sigvalue; /* Data passed with notification */
struct sigevent event; /* Describe the way a task is to be notified */
time_t reltime; /* Relative time in seconds */
};
@@ -322,9 +320,8 @@ struct lower_rdalarm_s
struct rtc_setperiodic_s
{
uint8_t id; /* Indicates the alarm to be set */
uint8_t signo; /* Signal number for alarm notification */
pid_t pid; /* Identifies task to be notified (0=caller) */
union sigval sigvalue; /* Data passed with notification */
struct sigevent event; /* Describe the way a task is to be notified */
struct timespec period; /* Period between wakeups */
};
@@ -48,6 +48,7 @@
#include <nuttx/config.h>
#include <signal.h>
#include <stdint.h>
#include <stdbool.h>
@@ -1706,7 +1707,7 @@ union ieee802154_macarg_u
/* To be determined */ /* MAC802154IOC_MLME_SOUNDING_REQUEST */
/* To be determined */ /* MAC802154IOC_MLME_CALIBRATE_REQUEST */
uint8_t signo; /* MAC802154IOC_NOTIFY_REGISTER */
struct sigevent event; /* MAC802154IOC_NOTIFY_REGISTER */
struct ieee802154_primitive_s primitive; /* MAC802154IOC_GET_EVENT */
bool enable; /* MAC802154IOC_ENABLE_EVENTS */
};