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-21
Revision:
20:15f22e814788
Parent:
19:8c5615d0768d
Child:
22:a100ca027173

File content as of revision 20:15f22e814788:

#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"

#ifndef SD_Present
#define SD_Present
#endif


//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);
    Print_thread.start(callback(&printQueue, &EventQueue::dispatch_forever));
    //printQueue.call(printf, "Event Queue Initialised \n\r");
}