OT_WEAK void dll_systask_rf(ot_task task) { ///Block callbacks while this runs (?) //radio_gag(); //do { switch (sys.task_RFA.event) { // Refresh task case 0: dll_refresh(); break; // Processing case 1: dll_processing(); break; // Session Activation: this can activate Radio Exotasks. case 2: dll_activate(); break; // RX Scan Timeout Watchdog case 3: dll_scan_timeout(); break; // CSMA Manager (needed for archaic radios only) //case 4: dll_txcsma(); break; // TX & CSMA Timeout Watchdog default: rm2_kill(); break; } //} while ((task->event != 0) && (task->nextevent <= 0)); //radio_ungag(); }
void sub_dll_flush(void) { /// (1) Put System states into the right place and flush existing events. /// (2) Reset sessions. /// (3) Set scheduler ids and prepare idle time events ot_task task; if (radio.state != RADIO_Idle) { rm2_kill(); } rm2_mac_configure(); # ifndef __KERNEL_NONE__ task = &sys.task_HSS; do { task->cursor = 0; task->reserve = 1; task->latency = 255; task->nextevent= 0; task++; } while (task < &sys.task[SSS_INDEX+1]); # endif session_init(); dll.idle_state = sub_default_idle(); dll_idle(); }
m2session* otapi_task_immediate(session_tmpl* s_tmpl, ot_app applet) { /// Make sure the radio is stopped, flush any interfering sessions, /// and create the new session to occur immediately (offset = 0). if (radio.state != RADIO_Idle) { rm2_kill(); } session_flush(); return sub_newtask(s_tmpl, applet, 0); }
/** SPIRIT1 Virtual ISR RF <BR> * ========================================================================<BR> */ void spirit1_virtual_isr(ot_u8 code) { switch (code) { case RFIV_RXTERM: rm2_kill(); break; case RFIV_RXSYNC: rm2_rxsync_isr(); break; case RFIV_RXEND: rm2_rxend_isr(); break; case 3: //spirit1drv_unsync_isr(); break; //Falling Edge case RFIV_RXFIFO: rm2_rxdata_isr(); break; case RFIV_CCAPASS: spirit1drv_ccapass_isr(); break; case RFIV_CCAFAIL: spirit1drv_ccafail_isr(); break; case RFIV_TXEND: case 8: spirit1drv_txend_isr(); break; case RFIV_TXFIFO: rm2_txdata_isr(); break; } }
OT_WEAK ot_u16 otapi_start_dialog(ot_u16 timeout) { /// Stop any ongoing processes and seed the event for the event manager. The /// radio killer will work in all cases, but it is bad form to kill sessions /// that are moving data. if (timeout != 0) { dll.comm.tc = TI2CLK(timeout); } ///@todo update null radio driver to modern interface # ifndef __KERNEL_NONE__ if (radio.state != RADIO_Idle) { rm2_kill(); } # endif # ifndef __KERNEL_NONE__ sys.task_RFA.event = 0; sys_preempt(&sys.task_RFA, 0); # endif return 1; }