houss red
/
Master_F
Master Implementation of WANOT
Embed:
(wiki syntax)
Show/hide line numbers
SuperSlot.cpp
00001 #include "WANOT.h" 00002 00003 /* 00004 * Global variables declarations 00005 */ 00006 00007 volatile SuperSlotStates SuperSlotState = SetUp_Beacon_Phase; 00008 Timeout SwitchState; 00009 00010 void SwitchState_Fn(void) 00011 { 00012 switch(SuperSlotState) { 00013 case SetUp_Beacon_Phase: 00014 debug("Switching to SetUp Phase State !!\n\r"); 00015 SuperSlotState = SetUp_Phase; 00016 SwitchState.attach(&SwitchState_Fn,SET_UP_INTERVAL); 00017 break; 00018 00019 case SetUp_Phase: 00020 debug("Switching to TDMA Phase State !!\n\r"); 00021 SuperSlotState = TDMA_Phase; 00022 SwitchState.attach(&SwitchState_Fn,TDMA_INTERVAL); 00023 break; 00024 00025 case TDMA_Phase: 00026 debug("SuperSlot States finished\n\r\n\r\n\r"); 00027 debug("Switching to SetUp Beacon State !! \n\r"); 00028 SuperSlotState = SetUp_Beacon_Phase; 00029 SwitchState.attach(&SwitchState_Fn, BEACON_SET_UP_INTERVAL); 00030 break; 00031 00032 } 00033 } 00034 00035 void SuperSlotInit () 00036 { 00037 00038 debug("Switching to SetUp Beacon State !! \n\r"); 00039 SuperSlotState = SetUp_Beacon_Phase; 00040 SwitchState.attach(&SwitchState_Fn, BEACON_SET_UP_INTERVAL); 00041 }
Generated on Wed Jul 13 2022 09:10:33 by 1.7.2