Latest

Dependencies:   serial_terminal sample_hardware PLL_Config SDCard BMP280 Networkbits TextLCD SDBlockDevice

Revision:
5:956984cbe447
Parent:
4:a4dd5fd5cad8
Child:
6:a5394c9e5927
--- a/main.cpp	Tue Nov 06 14:01:14 2018 +0000
+++ b/main.cpp	Tue Nov 06 19:19:45 2018 +0000
@@ -1,20 +1,29 @@
 #include "sample_hardware.hpp"
 #include "Networkbits.hpp"
+#include "serial_terminal.hpp"
+#include "rtos.h"
 
-// This is a very short demo that demonstrates all the hardware used in the coursework.
+
 // You will need a network connection set up (covered elsewhere). The host PC should have the address 10.0.0.1
 
 //Threads
-Thread nwrkThread;
+//Thread nwrkThread;
+Thread serial_terminal;
  
 
 int main() {
+    
+    
+    //Move threads into a thread init function
+    serial_terminal.start(serialterm);
+    
     //Greeting
     printf("Testing\n\n");    
     
     //Power on self test
     post();
     
+    /*
     //Initialise the SD card (this needs to move)
     if ( sd.init() != 0) {
         printf("Init failed \n");
@@ -57,8 +66,7 @@
         lcd.printf("%.2f\n",pressure);
         
         //Write to SD (potentially slow)
-        fprintf(fp, "%6.1f,%.2f\n\r", temp, pressure);
-        //printf("Printing\n\r");
+        //fprintf(fp, "%6.1f,%.2f\n\r", temp, pressure);
     }
     
     //Close File
@@ -69,13 +77,12 @@
     printf("Unmounted...\n");
     lcd.cls();
     lcd.printf("Unmounted...\n\n");
+    */
     
     //Flash to indicate goodness
     while(true) {
-        greenLED = 1;
-        wait(0.5);
-        greenLED = 0;
-        wait(0.1);    
+        greenLED = !greenLED;
+        Thread::wait(500);    
     }
 }