Latest
Dependencies: serial_terminal sample_hardware PLL_Config SDCard BMP280 Networkbits TextLCD SDBlockDevice
Diff: main.cpp
- Revision:
- 10:0fffc988d325
- Parent:
- 9:fa8a35d9d6c0
- Child:
- 11:3ad0327e8c9f
diff -r fa8a35d9d6c0 -r 0fffc988d325 main.cpp --- a/main.cpp Sat Nov 10 16:56:56 2018 +0000 +++ b/main.cpp Sat Nov 10 19:31:35 2018 +0000 @@ -7,28 +7,35 @@ #include "mbed_events.h" #include "LCDdisplay.hpp" + +//Signals #define TAKE_SAMPLE 1 -#define SAMPLE_RATE 5 + + + +float sample_rate = 15; +//bool sample_enable = true; //Queues EventQueue SDqueue; EventQueue LCDqueue; //Threads -Thread SDqueue_thread; -Thread LCDqueue_thread; +Thread SDqueue_thread(32*EVENTS_EVENT_SIZE); +Thread LCDqueue_thread(32*EVENTS_EVENT_SIZE); Thread sterm_thread; Thread sample_thread(osPriorityHigh); //Thread ntwkthread Ticker sample; + void sampleISR(void); void takesample(void); void samples(void); + FILE* fp; FATFileSystem* fs; -//FATFileSystem fs("sd", &sd); int main() { //Move threads into a thread init function? @@ -43,15 +50,16 @@ //Greeting - printf("Testing\n\n"); + printf("Testing\n\n"); + //Power on self test post(); printf("Send commands\n\r"); - sample.attach(&sampleISR, SAMPLE_RATE); - + sample.attach(&sampleISR, sample_rate); + //Flash to indicate goodness while(true) { @@ -80,6 +88,5 @@ SDqueue.call(SDaddSample,temp,pressure); } } -