Skip to content

Commit

Permalink
hal: Rename argument of hal_timerSetWakeup
Browse files Browse the repository at this point in the history
- Reason: The old name `when` is misleadig, since it is time to wait
  and not a fixed moment in time. Changed it to `waitUs`.

JIRA: RTOS-530
  • Loading branch information
astalke committed Nov 7, 2023
1 parent 39b0e4e commit 7b8d68b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
9 changes: 5 additions & 4 deletions hal/armv7a/imx6ull/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ static time_t hal_timerGetCyc(void)
}


void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
spinlock_ctx_t sc;
u32 cyc;

if (!when)
++when;
if (waitUs == 0) {
++waitUs;
}

cyc = when * 66;
cyc = waitUs * 66;

hal_spinlockSet(&timer_common.lock, &sc);
*(timer_common.epit1 + epit_lr) = cyc;
Expand Down
2 changes: 1 addition & 1 deletion hal/armv7a/zynq7000/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static time_t hal_timerGetCyc(void)
}


void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
}

Expand Down
8 changes: 4 additions & 4 deletions hal/armv7m/imxrt/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ static time_t hal_timerGetCyc(void)
}


void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
spinlock_ctx_t sc;

if (when > timer_common.interval) {
when = timer_common.interval;
if (waitUs > timer_common.interval) {
waitUs = timer_common.interval;
}

hal_spinlockSet(&timer_common.sp, &sc);
/* Modulo handled implicitly */
*(timer_common.base + gpt_ocr2) = hal_timerUs2Cyc(when) + *(timer_common.base + gpt_cnt);
*(timer_common.base + gpt_ocr2) = hal_timerUs2Cyc(waitUs) + *(timer_common.base + gpt_cnt);
*(timer_common.base + gpt_sr) |= 1 << 1;
hal_cpuDataMemoryBarrier();
hal_spinlockClear(&timer_common.sp, &sc);
Expand Down
2 changes: 1 addition & 1 deletion hal/armv7m/stm32/l4/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void timer_setAlarm(time_t us)
}


void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
}

Expand Down
2 changes: 1 addition & 1 deletion hal/armv8m/nrf/91/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int timer_irqHandler(unsigned int n, cpu_context_t *ctx, void *arg)
/* Interface functions */


void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
}

Expand Down
2 changes: 1 addition & 1 deletion hal/ia32/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int timer_irqHandler(unsigned int n, cpu_context_t *ctx, void *arg)
return 0;
}

void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
}

Expand Down
2 changes: 1 addition & 1 deletion hal/riscv64/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static int timer_irqHandler(unsigned int n, cpu_context_t *ctx, void *arg)
}


void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
}

Expand Down
2 changes: 1 addition & 1 deletion hal/sparcv8leon3/gr716/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ time_t hal_timerGetUs(void)
}


void hal_timerSetWakeup(u32 when)
void hal_timerSetWakeup(u32 waitUs)
{
}

Expand Down
2 changes: 1 addition & 1 deletion hal/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
extern time_t hal_timerGetUs(void);


extern void hal_timerSetWakeup(u32 when);
extern void hal_timerSetWakeup(u32 waitUs);


extern int hal_timerRegister(int (*f)(unsigned int, cpu_context_t *, void *), void *data, intr_handler_t *h);
Expand Down

0 comments on commit 7b8d68b

Please sign in to comment.