Skip to content

Commit

Permalink
cpu/nrf5x/timer: run task SHUTDOWN instead of STOP
Browse files Browse the repository at this point in the history
This is a workaround for errata 78 that causes increased current consumption even in the stopped state.
  • Loading branch information
jue89 committed Nov 22, 2022
1 parent 97bc825 commit a7e2182
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion cpu/nrf5x_common/periph/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,29 @@ void timer_start(tim_t tim)

void timer_stop(tim_t tim)
{
dev(tim)->TASKS_STOP = 1;
/* Errata: [78] TIMER: High current consumption when using
* timer STOP task only
*
* # Symptoms
*
* Increased current consumption when the timer has been running and the
* STOP task is used to stop it.
*
* # Conditions
* The timer has been running (after triggering a START task) and then it is
* stopped using a STOP task only.
*
* # Consequences
*
* Increased current consumption.
*
* # Workaround
*
* Use the SHUTDOWN task after the STOP task or instead of the STOP task
*
* cf. https://infocenter.nordicsemi.com/pdf/nRF52833_Engineering_A_Errata_v1.4.pdf
*/
dev(tim)->TASKS_SHUTDOWN = 1;
}

static inline void irq_handler(int num)
Expand Down

0 comments on commit a7e2182

Please sign in to comment.