Other Parts Discussed in Thread: CC2430, CC2530
I see the OSAL timer in Z stack 1.4.3-1.2.1 for CC2430 is the 8 bit timer. The timer tick for OSAL is 1ms. I also notice that there are two different timer update schemes: Interrupt enabled and poll enabled
1. poll enabled: poll in big loop of system tasks. Hal_ProcessPoll() function in OSAL_Start_system will call HalTimerTick() to set the callback function to update sys clock
2. Int enabled: in "HAL_ISR_FUNCTION" int vector, halProcessTimer4() will set the callback function to update sys clock
I think both way works, the first way is "fake" timer and it would delay the time for task process. the second should be more accurate but interrupt current task which could use timer as calibration.
I saw Z stack uses both in different version: depending on HAL_BOARD_INIT() is executed first(INT based) or InitBoard() is executed first(poll based) in ZMain.c
Is there anyone who can confirm my investigation is right or wrong. if it is right, which is the best way to configure timer?
thanks
Rui