xTimerCreate with hours/days cycle
Posted: Sun Nov 03, 2019 8:06 pm
Hello,
Based on the:
and
at best i get 65 000 which is slightly less then i need (43 200 000 = 12 h).
What is the proper technique to have a timer to sleep for hours?
Code: Select all
static const TickType_t t_outlet_cycle = 43200000 ; /* 12 hours in ms = 60 000*60*12 ; */
....
xTimerCreate(
"timer1Sec", /* name */
pdMS_TO_TICKS(t_outlet_cycle), /* period/time ms */
pdTRUE, /* auto reload */
(void*)0, /* timer ID */
CallBack/* callback */
);
Code: Select all
#define pdMS_TO_TICKS( xTimeInMs ) ( ( ( TickType_t ) ( xTimeInMs ) * configTICK_RATE_HZ ) / ( TickType_t ) 1000 )
#define configTICK_RATE_HZ ( CONFIG_FREERTOS_HZ )
#define CONFIG_FREERTOS_HZ 1000
Code: Select all
#if( configUSE_16_BIT_TICKS == 1 )
typedef uint16_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffff
#else
typedef uint32_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
#endif
What is the proper technique to have a timer to sleep for hours?