Hi,
I am having doubt in implementing network timer . shared time-sync code has the following code for timer
static void nwkStartTimer(int interval, void (*callback)(void))
{
nwkTimerCallback = callback;
SYS_TIMER3_COUNTER = 0;
SYS_TIMER3_PERIOD = interval;
SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
SYS_TIMER3_INTENSET = SYS_TIMER_INTFLAG_COUNT;
SYS_CTRL_INTENSET = SOC_IRQ_SYS_TIMER_3;
}
void irq_handler_timer3(void)
{
SYS_TIMER3_PERIOD = 0;
SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
nwkTimerCallback();
}
Can you tell me how to make it in MY side?
Moreover, I read the code, but can you explain the concept so that I make sure myself?
As far as I know, GATEWAY with address 0 sends SYNC command for the specified interval which depends NWK_MAX_SLOTS and NWK_SLOT_TIME. For example, NWK_MAX_SLOTS = 5 and NWK_SLOT_TIME = 10ms, SYNC command will be send for every 60 ms. Router (Or) End device at the other end will send data to GATEWAY upon receiving SYNC command .
Thanks,
Muthu