houss red
/
Master_F
Master Implementation of WANOT
Diff: main.cpp
- Revision:
- 0:8b449140caa2
diff -r 000000000000 -r 8b449140caa2 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 23 22:25:40 2016 +0000 @@ -0,0 +1,54 @@ +#include"WANOT.h" + +/* + * Global variables declarations + */ + +/*! + * Radio events function pointer + */ +RadioEvents_t RadioEvents; +SX1276MB1xAS Radio(NULL); + +extern SuperSlotStates SuperSlotState; + +Timer timer; +int begin, end; + +int main() +{ + + // verify the connection with the board + while (Radio.Read(REG_VERSION) == 0x00) { + debug("Radio could not be detected!\n\r\r", NULL); + wait(1); + } + debug("WANOT Master Started...\n\r"); + + char StoreRead[50]; + GPS_Read(StoreRead); + + SuperSlotInit(); + + uint8_t SlaveLocalID = 1; + + while(1) { + + switch(SuperSlotState) { + case SetUp_Beacon_Phase: + SetUp_Beacon(); + break; + + case SetUp_Phase: + MasterSetUp(); + break; + + case TDMA_Phase: + MasterTDMA(SlaveLocalID); + SlaveLocalID++; + break; + + } + } + +}