Network, SD, Readall. comments added

Dependencies:   Peripherals Buffer_lib_v2 SD_Lib_EffedUP_ERP Time_Lib_v2 Year3_Version5 BMP280 Network_Lib TextLCD BME280

main.cpp

Committer:
erolleyparnell
Date:
2019-01-23
Revision:
25:1f5b1ce3d65c
Parent:
24:bacf24afe91f
Child:
28:fb88aeb3551e

File content as of revision 25:1f5b1ce3d65c:

#include "mbed.h"
#include "TextLCD.h"
#include "SDBlockDevice.h"
#include "FATFileSystem.h"
#include "thread_functions.hpp"
#include "SD_functions.hpp"
#include "peripherals.hpp"
#include "Network.hpp"
#include "time_functions.hpp"



//Serial pc(SERIAL_TX, SERIAL_RX);
time_t currentTime;
Mutex date_mutex;
int setting;
int t;



Thread sensor_thread(osPriorityRealtime);    //sensor thread is highest priority
Thread serial_thread(osPriorityNormal);    
Thread SD_Card_thread(osPriorityNormal); 
Thread Network_thread(osPriorityNormal);
Thread Update_time_thread(osPriorityNormal);
Thread Print_thread(osPriorityNormal);


//LDR sensor
AnalogIn LDD_ADC_In(A1);
float fLDR = 0.0;
float volts = 0.0;


//Main thread
int main() {
    
    //Power On Check TODO
    lcd.cls();
    
    //FunctionSD1();
    
    // run threads
    sensor_thread.start(FunctionSensor);           
    serial_thread.start(FunctionSerial); 
    SD_Card_thread.start(FunctionSD1);
    Network_thread.start(Network);   
    Update_time_thread.start(UpdateTime);

}