Хочу поднять эту тему. Пытаюсь завести I2C через CPAL вместе с freeRTOSом. Подскажите как в cpal_conf.h замутить таймер через vApplicationTickHook(), который у меня отсчитывает миллисекунды.
Я так полагаю это делается В от здесь. Но как правильно это дело задефайнить не догоняю.
Код
/* -- Section 4 : **** Configure Timeout method, TimeoutCallback ****
Description: This section allows you to implement your own Timeout Procedure.
By default Timeout procedure is implemented with Systick timer and
CPAL_I2C_TIMEOUT_Manager is defined as SysTick_Handler.
*/
#define _CPAL_TIMEOUT_INIT() SysTick_Config((SystemCoreClock / 1000));\
NVIC_SetPriority (SysTick_IRQn, 0)
/*<! Configure and enable the systick timer
to generate an interrupt when counter value
reaches 0. In the Systick interrupt handler
the Timeout Error function is called. Time base is 1 ms */
#define _CPAL_TIMEOUT_DEINIT() SysTick->CTRL = 0 /*<! Disable the systick timer */
#define CPAL_I2C_TIMEOUT_Manager SysTick_Handler /*<! This callback is used to handle Timeout error.
When a timeout occurs CPAL_TIMEOUT_UserCallback
is called to handle this error */
#ifndef CPAL_I2C_TIMEOUT_Manager
void CPAL_I2C_TIMEOUT_Manager(void);
#else
void SysTick_Handler(void);
#endif /* CPAL_I2C_TIMEOUT_Manager */
/*#define CPAL_TIMEOUT_UserCallback (void)*/ /*<! Comment this line and implement the callback body in your
application in order to use the Timeout Callback.
It is strongly advised to implement this callback, since it
is the only way to manage timeout errors. */
В общем основной вопрос как прикрутить к CPAL свой собственный таймер.