Ensure ticks per timeslice is greater than zero

This commit is contained in:
Zack leung
2024-03-14 12:53:50 -05:00
committed by Joel Sherrill
parent fd790b3431
commit 5ee87eee8a
2 changed files with 5 additions and 2 deletions

View File

@@ -3312,8 +3312,7 @@
* @parblock
* The following constraints apply to this configuration option:
*
* * The value of the configuration option shall be greater than or equal to
* zero.
* * The value of the configuration option shall be greater than zero.
*
* * The value of the configuration option shall be less than or equal to <a
* href="https://en.cppreference.com/w/c/types/integer">UINT32_MAX</a>.

View File

@@ -70,6 +70,10 @@
#warning "The clock ticks per second is not an integer"
#endif
#if defined(CONFIGURE_TICKS_PER_TIMESLICE) && CONFIGURE_TICKS_PER_TIMESLICE <= 0
#error "CONFIGURE_TICKS_PER_TIMESLICE shall be greater than zero"
#endif
#if CONFIGURE_MICROSECONDS_PER_TICK <= 0
#error "CONFIGURE_MICROSECONDS_PER_TICK must be positive"
#endif