houss red
/
Master_F
Master Implementation of WANOT
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include"WANOT.h" 00002 00003 /* 00004 * Global variables declarations 00005 */ 00006 00007 /*! 00008 * Radio events function pointer 00009 */ 00010 RadioEvents_t RadioEvents; 00011 SX1276MB1xAS Radio(NULL); 00012 00013 extern SuperSlotStates SuperSlotState; 00014 00015 Timer timer; 00016 int begin, end; 00017 00018 int main() 00019 { 00020 00021 // verify the connection with the board 00022 while (Radio.Read(REG_VERSION) == 0x00) { 00023 debug("Radio could not be detected!\n\r\r", NULL); 00024 wait(1); 00025 } 00026 debug("WANOT Master Started...\n\r"); 00027 00028 char StoreRead[50]; 00029 GPS_Read(StoreRead); 00030 00031 SuperSlotInit(); 00032 00033 uint8_t SlaveLocalID = 1; 00034 00035 while(1) { 00036 00037 switch(SuperSlotState) { 00038 case SetUp_Beacon_Phase: 00039 SetUp_Beacon(); 00040 break; 00041 00042 case SetUp_Phase: 00043 MasterSetUp(); 00044 break; 00045 00046 case TDMA_Phase: 00047 MasterTDMA(SlaveLocalID); 00048 SlaveLocalID++; 00049 break; 00050 00051 } 00052 } 00053 00054 }
Generated on Wed Jul 13 2022 09:10:33 by 1.7.2