stm32l4 oneshot: assert period > 0, otherwise the timer never fires
This commit is contained in:
parent
edd3dd3168
commit
3c37d68735
@ -313,6 +313,7 @@ int stm32l4_oneshot_start(FAR struct stm32l4_oneshot_s *oneshot,
|
|||||||
period = (usec * (uint64_t)oneshot->frequency) / USEC_PER_SEC;
|
period = (usec * (uint64_t)oneshot->frequency) / USEC_PER_SEC;
|
||||||
|
|
||||||
tmrinfo("usec=%llu period=%08llx\n", usec, period);
|
tmrinfo("usec=%llu period=%08llx\n", usec, period);
|
||||||
|
DEBUGASSERT(period > 0);
|
||||||
DEBUGASSERT(period <= UINT32_MAX);
|
DEBUGASSERT(period <= UINT32_MAX);
|
||||||
|
|
||||||
/* Set up to receive the callback when the interrupt occurs */
|
/* Set up to receive the callback when the interrupt occurs */
|
||||||
|
Loading…
Reference in New Issue
Block a user