ticks per second depends on LED number

This commit is contained in:
King Kévin 2016-04-05 10:01:37 +02:00
parent 577d1ba607
commit b7709355be
1 changed files with 2 additions and 1 deletions

3
main.c
View File

@ -52,12 +52,13 @@ volatile bool time_flag = false; /**< flag set when time changed */
volatile bool photoresistor_flag = false; /**< flag set when ambient luminosity is measured */
/** @} */
#define TICKS_PER_SECOND 256 /**< the number of ticks in one second */
/** @defgroup main_ticks ticks per time units
* @note these are derived from TICKS_PER_SECOND
* @note I have to use type variables because defines would be stored in signed integers, leading to an overflow it later calculations
* @{
*/
/** the number of ticks in one second (depend on the number of LED since it tries to have 255 tick per LED per second) */
#define TICKS_PER_SECOND 256*WS2812B_LEDS/60
/** number of ticks in one second */
const uint32_t ticks_second = TICKS_PER_SECOND;
/** number of ticks in one minute */