Ported the stack-friendly clock ISR code over from cc243x to cc253x
This commit is contained in:
parent
11a7f644ac
commit
b3de052e01
3 changed files with 31 additions and 0 deletions
|
@ -45,6 +45,10 @@ PROCESS_NAME(viztool_process);
|
|||
#define PUTCHAR(...) do {} while(0)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if CLOCK_CONF_STACK_FRIENDLY
|
||||
extern volatile __bit sleep_flag;
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
extern rimeaddr_t rimeaddr_node_addr;
|
||||
static __data int r;
|
||||
static __data int len;
|
||||
|
@ -252,6 +256,16 @@ main(void)
|
|||
do {
|
||||
/* Reset watchdog and handle polls and events */
|
||||
watchdog_periodic();
|
||||
|
||||
#if CLOCK_CONF_STACK_FRIENDLY
|
||||
if(sleep_flag) {
|
||||
if(etimer_pending() &&
|
||||
(etimer_next_expiration_time() - clock_time() - 1) > MAX_TICKS) {
|
||||
etimer_request_poll();
|
||||
}
|
||||
sleep_flag = 0;
|
||||
}
|
||||
#endif
|
||||
r = process_run();
|
||||
} while(r > 0);
|
||||
len = NETSTACK_RADIO.pending_packet();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue