working version of song control with initialization from sd card
Dependencies: MFRC522 NRF2401P SDFileSystem SPI_TFT_ILI9341 TFT_fonts mbed
Fork of Song_Control by
Diff: hub.cpp
- Revision:
- 1:c2232b1eaf31
- Child:
- 2:d1eae91343a9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hub.cpp Sun Jan 24 16:15:53 2016 +0000 @@ -0,0 +1,43 @@ +/** +* All the code associated to run the mbed as a hub. +* Link with locker +*/ +#include "mbed.h" +#include "utils.h" +#define debug + +// Flags +// Variables +// tx nRF2401 + +long long addrLcker=0xBBBBBBBBBB; +extern int channel; + +// Initializaton +/** +* Initialise for a locker +* fp is the config file if additonal information is needed. +*/ +void initialiseHub(FILE *fp){ +#ifdef debug + printf("Initialise Hub\n\r"); +#endif + + // Read in hub address and channel + if (fscanf (fp,"%x %*c %*s",&channel )!=1) writeError("Hub config: cannot read channel"); + if (fscanf (fp,"%llx %*c %*s",&addrLcker )!=1) writeError("Hub config: cannot read hub address"); + +#ifdef debug + printf(" Channel:%x, Hub Address %llx \n\r",channel, addrLcker); +#endif + + +} +// Interupt routines + + +// Loop through slow routines + +void loopHub(){ + +} \ No newline at end of file