Esempio n. 1
0
OT_WEAK void radio_finish(ot_int main_err, ot_int frame_err) {
/// Reset radio & callback to null state, then run saved callback
    ot_sig2 callback;
    radio_gag();                            // redundant, but here until more debugging done
    //radio.state     = RADIO_Idle;         // redundant, and do
    rfctl.state     = 0;
    rfctl.flags    &= (RADIO_FLAG_XOON | RADIO_FLAG_SETPWR);    //clear all other flags
    callback        = radio.evtdone;
    radio.evtdone   = &otutils_sig2_null;
    callback(main_err, frame_err);
}
Esempio n. 2
0
OT_WEAK void dll_idle(void) {
/// Idle Routine: Disable radio and manipulate system tasks in order to go into
/// the type of idle that is configured in dll.idle_state (OFF, SLEEP, HOLD)
	static const ot_u8 scan_events[] = { 0,0, 0,5, 4,0, 1,0 };
	ot_u8* scan_evt_ptr;

    /// Make sure Radio is powered-down
	radio_gag();
    radio_sleep();

    /// Assure all DLL tasks are in IDLE
#   ifndef __KERNEL_NONE__
    sys.task_RFA.event  = 0;
    scan_evt_ptr        = (ot_u8*)&scan_events[dll.idle_state<<1];
    sys.task_HSS.event  = *scan_evt_ptr;
    sys.task_SSS.event  = *(++scan_evt_ptr);

#   if (M2_FEATURE(BEACONS) == ENABLED)
    sys.task_BTS.event  = ((dll.netconf.b_attempts != 0) \
    		            && (dll.idle_state != M2_DLLIDLE_OFF));
#   endif
#   endif
}