stm32l4 oneshot: assert period > 0, otherwise the timer never fires

This commit is contained in:
Matias Nitsche 2020-06-21 10:52:06 -03:00 committed by Abdelatif Guettouche
parent edd3dd3168
commit 3c37d68735

View File

@ -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 */