mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
timers/oneshot: Remove all callback and args.
This commit remove all callback and args in the APIs. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
committed by
Alin Jerpelea
parent
5c113f79b7
commit
fc28b93224
@@ -76,7 +76,6 @@ struct arm_timer_lowerhalf_s
|
||||
static int arm_timer_maxdelay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int arm_timer_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int arm_timer_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -168,7 +167,6 @@ static int arm_timer_maxdelay(struct oneshot_lowerhalf_s *lower_,
|
||||
}
|
||||
|
||||
static int arm_timer_start(struct oneshot_lowerhalf_s *lower_,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct arm_timer_lowerhalf_s *lower =
|
||||
|
||||
@@ -75,7 +75,6 @@ struct arm_timer_lowerhalf_s
|
||||
static int arm_timer_maxdelay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int arm_timer_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int arm_timer_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -161,7 +160,6 @@ static int arm_timer_maxdelay(struct oneshot_lowerhalf_s *lower_,
|
||||
}
|
||||
|
||||
static int arm_timer_start(struct oneshot_lowerhalf_s *lower_,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct arm_timer_lowerhalf_s *lower =
|
||||
|
||||
@@ -243,7 +243,6 @@ static int arm_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int arm_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
uint64_t count;
|
||||
@@ -251,7 +250,7 @@ static int arm_start(struct oneshot_lowerhalf_s *lower,
|
||||
(struct arm_oneshot_lowerhalf_s *)lower;
|
||||
uint64_t freq = priv->frequency;
|
||||
|
||||
DEBUGASSERT(priv && callback && ts);
|
||||
DEBUGASSERT(priv && ts);
|
||||
|
||||
/* Set the timeout */
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ static void sam_oneshot_handler(void *arg);
|
||||
static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int sam_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -181,7 +180,6 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct sam_oneshot_lowerhalf_s *priv =
|
||||
@@ -189,7 +187,7 @@ static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ static void sam_oneshot_handler(void *arg);
|
||||
static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int sam_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -183,7 +182,6 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct sam_oneshot_lowerhalf_s *priv =
|
||||
@@ -191,7 +189,7 @@ static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ static void sam_oneshot_handler(void *arg);
|
||||
static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int sam_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -181,7 +180,6 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct sam_oneshot_lowerhalf_s *priv =
|
||||
@@ -189,7 +187,7 @@ static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ static void sam_oneshot_handler(void *arg);
|
||||
static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int sam_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -181,7 +180,6 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct sam_oneshot_lowerhalf_s *priv =
|
||||
@@ -189,7 +187,7 @@ static int sam_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ static void stm32_oneshot_handler(void *arg);
|
||||
static int stm32_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int stm32_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int stm32_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -180,7 +179,6 @@ static int stm32_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct stm32_oneshot_lowerhalf_s *priv =
|
||||
@@ -188,7 +186,7 @@ static int stm32_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ static void stm32_oneshot_handler(void *arg);
|
||||
static int stm32_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int stm32_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int stm32_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -180,7 +179,6 @@ static int stm32_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct stm32_oneshot_lowerhalf_s *priv =
|
||||
@@ -188,7 +186,7 @@ static int stm32_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ static void stm32l4_oneshot_handler(void *arg);
|
||||
static int stm32l4_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int stm32l4_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int stm32l4_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -181,7 +180,6 @@ static int stm32l4_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32l4_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct stm32l4_oneshot_lowerhalf_s *priv =
|
||||
@@ -189,7 +187,7 @@ static int stm32l4_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ static void stm32wb_oneshot_handler(void *arg);
|
||||
static int stm32wb_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int stm32wb_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int stm32wb_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -181,15 +180,14 @@ static int stm32wb_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int stm32wb_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct stm32wb_oneshot_lowerhalf_s *priv =
|
||||
(struct stm32wb_oneshot_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -235,7 +235,6 @@ static int arm64_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int arm64_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
uint64_t count;
|
||||
@@ -243,7 +242,7 @@ static int arm64_start(struct oneshot_lowerhalf_s *lower,
|
||||
(struct arm64_oneshot_lowerhalf_s *)lower;
|
||||
uint64_t freq = priv->frequency;
|
||||
|
||||
DEBUGASSERT(priv && callback && ts);
|
||||
DEBUGASSERT(priv && ts);
|
||||
|
||||
priv->running = this_cpu();
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ static void pic32mz_oneshot_handler(void *arg);
|
||||
static int pic32mz_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int pic32mz_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int pic32mz_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -182,7 +181,6 @@ static int pic32mz_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int pic32mz_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct pic32mz_oneshot_lowerhalf_s *priv =
|
||||
@@ -190,7 +188,7 @@ static int pic32mz_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -84,8 +84,6 @@ struct bl602_oneshot_lowerhalf_s
|
||||
static int bl602_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec * ts);
|
||||
static int bl602_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void * arg,
|
||||
const struct timespec * ts);
|
||||
static int bl602_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec * ts);
|
||||
@@ -229,8 +227,6 @@ static int bl602_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int bl602_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void * arg,
|
||||
const struct timespec * ts)
|
||||
{
|
||||
struct bl602_oneshot_lowerhalf_s *priv =
|
||||
@@ -238,7 +234,7 @@ static int bl602_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
uint64_t usec;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
if (priv->started == true)
|
||||
{
|
||||
|
||||
@@ -97,8 +97,6 @@ static int esp_oneshot_isr(int irq, void *context, void *arg);
|
||||
static int esp_oneshot_maxdelay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int esp_oneshot_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts);
|
||||
static int esp_oneshot_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -193,8 +191,6 @@ static int esp_oneshot_maxdelay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int esp_oneshot_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct esp_oneshot_lowerhalf_s *priv =
|
||||
@@ -202,11 +198,9 @@ static int esp_oneshot_start(struct oneshot_lowerhalf_s *lower,
|
||||
uint64_t timeout_us;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
DEBUGASSERT(callback != NULL);
|
||||
DEBUGASSERT(ts != NULL);
|
||||
|
||||
tmrinfo("callback=%p arg=%p, ts=(%lu, %ld)\n",
|
||||
callback, arg, (unsigned long)ts->tv_sec, ts->tv_nsec);
|
||||
tmrinfo("ts=(%lu, %ld)\n", (unsigned long)ts->tv_sec, ts->tv_nsec);
|
||||
|
||||
if (priv->running)
|
||||
{
|
||||
@@ -269,11 +263,8 @@ static int esp_oneshot_start(struct oneshot_lowerhalf_s *lower,
|
||||
|
||||
/* Configure callback, in case a handler was provided before */
|
||||
|
||||
if (priv->callback != NULL)
|
||||
{
|
||||
timer_ll_enable_intr(hal->dev, TIMER_LL_EVENT_ALARM(hal->timer_id),
|
||||
true);
|
||||
}
|
||||
timer_ll_enable_intr(hal->dev, TIMER_LL_EVENT_ALARM(hal->timer_id),
|
||||
true);
|
||||
|
||||
/* Finally, start the timer */
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ struct riscv_mtimer_lowerhalf_s
|
||||
static int riscv_mtimer_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int riscv_mtimer_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int riscv_mtimer_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -137,7 +136,6 @@ static int riscv_mtimer_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int riscv_mtimer_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct riscv_mtimer_lowerhalf_s *priv =
|
||||
|
||||
@@ -72,8 +72,6 @@ static void esp32c3_oneshot_lh_handler(void *arg);
|
||||
static int oneshot_lh_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts);
|
||||
static int oneshot_lh_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -187,8 +185,6 @@ static int oneshot_lh_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct esp32c3_oneshot_lowerhalf_s *priv =
|
||||
@@ -197,8 +193,6 @@ static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
DEBUGASSERT(callback != NULL);
|
||||
DEBUGASSERT(arg != NULL);
|
||||
DEBUGASSERT(ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
@@ -74,7 +74,6 @@ static void sim_process_tick(sq_entry_t *entry);
|
||||
static int sim_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int sim_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int sim_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -290,14 +289,14 @@ static int sim_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int sim_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct sim_oneshot_lowerhalf_s *priv =
|
||||
(struct sim_oneshot_lowerhalf_s *)lower;
|
||||
struct timespec current;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
|
||||
@@ -71,8 +71,7 @@ static void bm3803_oneshot_handler(void *arg);
|
||||
static int bm3803_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int bm3803_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
const struct timespec *ts);
|
||||
static int bm3803_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
|
||||
@@ -183,15 +182,14 @@ static int bm3803_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int bm3803_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct bm3803_oneshot_lowerhalf_s *priv =
|
||||
(struct bm3803_oneshot_lowerhalf_s *)lower;
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ struct tricore_systimer_lowerhalf_s
|
||||
static int tricore_systimer_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int tricore_systimer_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int tricore_systimer_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -168,7 +167,6 @@ static int tricore_systimer_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int tricore_systimer_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct tricore_systimer_lowerhalf_s *priv =
|
||||
|
||||
@@ -60,16 +60,14 @@ static void intel64_oneshot_handler(void *arg);
|
||||
static int intel64_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int intel64_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
const struct timespec *ts);
|
||||
static int intel64_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
struct timespec *ts);
|
||||
static int intel64_current(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int intel64_tick_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
clock_t *ticks);
|
||||
static int intel64_tick_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
clock_t ticks);
|
||||
static int intel64_tick_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
clock_t *ticks);
|
||||
@@ -190,7 +188,6 @@ static int intel64_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int intel64_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct intel64_oneshot_lowerhalf_s *priv =
|
||||
@@ -198,7 +195,7 @@ static int intel64_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
DEBUGASSERT(priv != NULL && ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
@@ -352,7 +349,6 @@ static int intel64_tick_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int intel64_tick_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
clock_t ticks)
|
||||
{
|
||||
struct timespec ts;
|
||||
@@ -361,7 +357,7 @@ static int intel64_tick_start(struct oneshot_lowerhalf_s *lower,
|
||||
|
||||
clock_ticks2time(&ts, ticks);
|
||||
|
||||
return intel64_start(lower, callback, arg, &ts);
|
||||
return intel64_start(lower, &ts);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -57,7 +57,6 @@ struct xoneshot_lowerhalf_s
|
||||
static int xtensa_oneshot_maxdelay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int xtensa_oneshot_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts);
|
||||
static int xtensa_oneshot_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -93,7 +92,6 @@ static inline uint64_t sec_to_count(uint32_t sec, uint32_t freq)
|
||||
}
|
||||
|
||||
static int xtensa_oneshot_start(struct oneshot_lowerhalf_s *lower_,
|
||||
oneshot_callback_t callback, void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct xoneshot_lowerhalf_s *lower =
|
||||
|
||||
@@ -73,8 +73,6 @@ static void esp32_oneshot_lh_handler(void *arg);
|
||||
static int esp32_max_lh_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int esp32_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts);
|
||||
static int esp32_lh_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -184,8 +182,6 @@ static int esp32_max_lh_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int esp32_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct esp32_oneshot_lowerhalf_s *priv =
|
||||
@@ -194,7 +190,6 @@ static int esp32_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
DEBUGASSERT(callback != NULL);
|
||||
DEBUGASSERT(ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
@@ -70,8 +70,6 @@ static void esp32s2_oneshot_lh_handler(void *arg);
|
||||
static int oneshot_lh_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts);
|
||||
static int oneshot_lh_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -185,8 +183,6 @@ static int oneshot_lh_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct esp32s2_oneshot_lowerhalf_s *priv =
|
||||
@@ -195,8 +191,6 @@ static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
DEBUGASSERT(callback != NULL);
|
||||
DEBUGASSERT(arg != NULL);
|
||||
DEBUGASSERT(ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
@@ -72,8 +72,6 @@ static void oneshot_lh_handler(void *arg);
|
||||
static int oneshot_lh_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts);
|
||||
static int oneshot_lh_cancel(struct oneshot_lowerhalf_s *lower,
|
||||
struct timespec *ts);
|
||||
@@ -185,8 +183,6 @@ static int oneshot_lh_max_delay(struct oneshot_lowerhalf_s *lower,
|
||||
****************************************************************************/
|
||||
|
||||
static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback,
|
||||
void *arg,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct esp32s3_oneshot_lowerhalf_s *priv =
|
||||
@@ -195,7 +191,6 @@ static int oneshot_lh_start(struct oneshot_lowerhalf_s *lower,
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
DEBUGASSERT(callback != NULL);
|
||||
DEBUGASSERT(ts != NULL);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
@@ -390,7 +390,7 @@ static void next_note(FAR struct tone_upperhalf_s *upper)
|
||||
ts.tv_sec = (time_t) sec;
|
||||
ts.tv_nsec = (unsigned long)nsec;
|
||||
|
||||
ONESHOT_START(upper->oneshot, oneshot_callback, upper, &ts);
|
||||
ONESHOT_START(upper->oneshot, &ts);
|
||||
|
||||
g_silence_length = 0;
|
||||
return;
|
||||
@@ -524,7 +524,7 @@ static void next_note(FAR struct tone_upperhalf_s *upper)
|
||||
ts.tv_sec = (time_t) sec;
|
||||
ts.tv_nsec = (unsigned long)nsec;
|
||||
|
||||
ONESHOT_START(upper->oneshot, oneshot_callback, upper, &ts);
|
||||
ONESHOT_START(upper->oneshot, &ts);
|
||||
return;
|
||||
|
||||
/* Change tempo */
|
||||
@@ -567,7 +567,7 @@ static void next_note(FAR struct tone_upperhalf_s *upper)
|
||||
ts.tv_sec = (time_t) sec;
|
||||
ts.tv_nsec = (unsigned long)nsec;
|
||||
|
||||
ONESHOT_START(upper->oneshot, oneshot_callback, upper, &ts);
|
||||
ONESHOT_START(upper->oneshot, &ts);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -651,7 +651,7 @@ static void next_note(FAR struct tone_upperhalf_s *upper)
|
||||
|
||||
/* And arrange a callback when the note should stop */
|
||||
|
||||
ONESHOT_START(upper->oneshot, oneshot_callback, upper, &ts);
|
||||
ONESHOT_START(upper->oneshot, &ts);
|
||||
return;
|
||||
|
||||
/* Tune looks bad (unexpected EOF, bad character, etc.) */
|
||||
|
||||
@@ -59,7 +59,7 @@ static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
|
||||
* atomically w. respect to a HW timer
|
||||
*/
|
||||
|
||||
ONESHOT_TICK_START(g_oneshot_lower, oneshot_callback, NULL, 1);
|
||||
ONESHOT_TICK_START(g_oneshot_lower, 1);
|
||||
|
||||
/* It is always an error if this progresses more than 1 tick at a time.
|
||||
* That would break any timer based on wdog; such timers might timeout
|
||||
@@ -98,7 +98,7 @@ void up_alarm_set_lowerhalf(FAR struct oneshot_lowerhalf_s *lower)
|
||||
g_oneshot_maxticks = ticks < UINT32_MAX ? ticks : UINT32_MAX;
|
||||
#else
|
||||
ONESHOT_TICK_CURRENT(g_oneshot_lower, &g_current_tick);
|
||||
ONESHOT_TICK_START(g_oneshot_lower, oneshot_callback, NULL, 1);
|
||||
ONESHOT_TICK_START(g_oneshot_lower, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -272,8 +272,7 @@ int weak_function up_alarm_tick_start(clock_t ticks)
|
||||
delta = 0;
|
||||
}
|
||||
|
||||
ret = ONESHOT_TICK_START(g_oneshot_lower, oneshot_callback,
|
||||
NULL, delta);
|
||||
ret = ONESHOT_TICK_START(g_oneshot_lower, delta);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -75,8 +75,6 @@ struct goldfish_timer_lowerhalf_s
|
||||
static int goldfish_timer_maxdelay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
static int goldfish_timer_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR oneshot_callback_t callback,
|
||||
FAR void *arg,
|
||||
FAR const struct timespec *ts);
|
||||
static int goldfish_timer_cancel(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
@@ -109,8 +107,6 @@ static int goldfish_timer_maxdelay(FAR struct oneshot_lowerhalf_s *lower_,
|
||||
}
|
||||
|
||||
static int goldfish_timer_start(FAR struct oneshot_lowerhalf_s *lower_,
|
||||
FAR oneshot_callback_t callback,
|
||||
FAR void *arg,
|
||||
FAR const struct timespec *ts)
|
||||
{
|
||||
FAR struct goldfish_timer_lowerhalf_s *lower =
|
||||
|
||||
@@ -215,8 +215,7 @@ static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Start the oneshot timer */
|
||||
|
||||
ret = ONESHOT_START(priv->od_lower, oneshot_callback, priv,
|
||||
&start->ts);
|
||||
ret = ONESHOT_START(priv->od_lower, &start->ts);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ watchdog_automonitor_oneshot(FAR struct oneshot_lowerhalf_s *oneshot,
|
||||
};
|
||||
|
||||
lower->ops->keepalive(lower);
|
||||
ONESHOT_START(oneshot, watchdog_automonitor_oneshot, upper, &ts);
|
||||
ONESHOT_START(oneshot, &ts);
|
||||
}
|
||||
}
|
||||
#elif defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_TIMER)
|
||||
@@ -275,7 +275,7 @@ watchdog_automonitor_start(FAR struct watchdog_upperhalf_s *upper)
|
||||
};
|
||||
|
||||
upper->oneshot = oneshot;
|
||||
ONESHOT_START(oneshot, watchdog_automonitor_oneshot, upper, &ts);
|
||||
ONESHOT_START(oneshot, &ts);
|
||||
#elif defined(CONFIG_WATCHDOG_AUTOMONITOR_BY_TIMER)
|
||||
upper->timer = timer;
|
||||
timer->ops->setcallback(timer, watchdog_automonitor_timer, upper);
|
||||
|
||||
@@ -120,10 +120,10 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define ONESHOT_START(l,h,a,t) \
|
||||
((l)->ops->start ? (l)->ops->start(l,h,a,t) : oneshot_start(l,h,a,t))
|
||||
#define ONESHOT_TICK_START(l,h,a,t) \
|
||||
((l)->ops->tick_start ? (l)->ops->tick_start(l,h,a,t) : oneshot_tick_start(l,h,a,t))
|
||||
#define ONESHOT_START(l,t) \
|
||||
((l)->ops->start ? (l)->ops->start(l,t) : oneshot_start(l,t))
|
||||
#define ONESHOT_TICK_START(l,t) \
|
||||
((l)->ops->tick_start ? (l)->ops->tick_start(l,t) : oneshot_tick_start(l,t))
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ONESHOT_CANCEL
|
||||
@@ -202,7 +202,6 @@ struct oneshot_operations_s
|
||||
CODE int (*max_delay)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
CODE int (*start)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
FAR const struct timespec *ts);
|
||||
CODE int (*cancel)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
@@ -211,7 +210,6 @@ struct oneshot_operations_s
|
||||
CODE int (*tick_max_delay)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR clock_t *ticks);
|
||||
CODE int (*tick_start)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
clock_t ticks);
|
||||
CODE int (*tick_cancel)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR clock_t *ticks);
|
||||
@@ -284,7 +282,6 @@ int oneshot_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
|
||||
static inline
|
||||
int oneshot_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
FAR const struct timespec *ts)
|
||||
{
|
||||
clock_t tick;
|
||||
@@ -295,7 +292,7 @@ int oneshot_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
}
|
||||
|
||||
tick = clock_time2ticks(ts);
|
||||
return lower->ops->tick_start(lower, callback, arg, tick);
|
||||
return lower->ops->tick_start(lower, tick);
|
||||
}
|
||||
|
||||
static inline
|
||||
@@ -353,7 +350,6 @@ int oneshot_tick_max_delay(FAR struct oneshot_lowerhalf_s *lower,
|
||||
|
||||
static inline
|
||||
int oneshot_tick_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
clock_t ticks)
|
||||
{
|
||||
struct timespec ts;
|
||||
@@ -364,7 +360,7 @@ int oneshot_tick_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
}
|
||||
|
||||
clock_ticks2time(&ts, ticks);
|
||||
return lower->ops->start(lower, callback, arg, &ts);
|
||||
return lower->ops->start(lower, &ts);
|
||||
}
|
||||
|
||||
static inline
|
||||
|
||||
@@ -199,8 +199,7 @@ static void nxsched_oneshot_start(void)
|
||||
ts.tv_sec = secs;
|
||||
ts.tv_nsec = 1000 * usecs;
|
||||
|
||||
DEBUGVERIFY(ONESHOT_START(g_sched_oneshot.oneshot,
|
||||
nxsched_oneshot_callback, NULL, &ts));
|
||||
DEBUGVERIFY(ONESHOT_START(g_sched_oneshot.oneshot, &ts));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user