Comments added
Dependencies: Peripherals Buffer_lib_v2 SD_Lib_EffedUP_ERP Time_Lib_v2 Year3_Version5 BMP280 Network_Lib TextLCD BME280
main.cpp@16:17e8f7d4241a, 2019-01-04 (annotated)
- Committer:
- cgogay
- Date:
- Fri Jan 04 11:30:18 2019 +0000
- Revision:
- 16:17e8f7d4241a
- Parent:
- 15:00422efe0550
- Child:
- 17:a3cc9013316c
sensor thread made higher priority, added sensor mutex lock to network lib
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
noutram | 0:90e393878517 | 1 | #include "mbed.h" |
emilytrembeth | 4:da63962bc0f1 | 2 | #include "TextLCD.h" |
emilytrembeth | 4:da63962bc0f1 | 3 | #include "SDBlockDevice.h" |
emilytrembeth | 4:da63962bc0f1 | 4 | #include "FATFileSystem.h" |
erolleyparnell | 8:dde5976445b4 | 5 | #include "thread_functions.hpp" |
erolleyparnell | 11:799025124e87 | 6 | #include "SD_functions.hpp" |
erolleyparnell | 11:799025124e87 | 7 | #include "peripherals.hpp" |
emilytrembeth | 15:00422efe0550 | 8 | #include "Network.hpp" |
emilytrembeth | 5:60e116a1e913 | 9 | |
erolleyparnell | 13:a89d4591af3f | 10 | #ifndef SD_Present |
erolleyparnell | 13:a89d4591af3f | 11 | #define SD_Present |
erolleyparnell | 13:a89d4591af3f | 12 | #endif |
erolleyparnell | 13:a89d4591af3f | 13 | |
erolleyparnell | 13:a89d4591af3f | 14 | #ifndef DEBUG |
erolleyparnell | 13:a89d4591af3f | 15 | #define DEBUG |
erolleyparnell | 13:a89d4591af3f | 16 | #endif |
erolleyparnell | 13:a89d4591af3f | 17 | |
emilytrembeth | 15:00422efe0550 | 18 | //Serial pc(SERIAL_TX, SERIAL_RX); |
emilytrembeth | 4:da63962bc0f1 | 19 | time_t currentTime; |
emilytrembeth | 4:da63962bc0f1 | 20 | Mutex date_mutex; |
emilytrembeth | 5:60e116a1e913 | 21 | int setting; |
emilytrembeth | 5:60e116a1e913 | 22 | int t; |
noutram | 0:90e393878517 | 23 | |
cgogay | 16:17e8f7d4241a | 24 | Thread t1(osPriorityRealtime); //sensor thread is highest priority |
cgogay | 16:17e8f7d4241a | 25 | Thread t2(osPriorityNormal); |
cgogay | 16:17e8f7d4241a | 26 | Thread t3(osPriorityNormal); |
cgogay | 16:17e8f7d4241a | 27 | Thread t4(osPriorityNormal); |
cgogay | 7:981670f59caf | 28 | |
cgogay | 7:981670f59caf | 29 | |
cgogay | 7:981670f59caf | 30 | //LDR sensor |
cgogay | 7:981670f59caf | 31 | AnalogIn LDD_ADC_In(A1); |
cgogay | 7:981670f59caf | 32 | float fLDR = 0.0; |
cgogay | 7:981670f59caf | 33 | float volts = 0.0; |
cgogay | 7:981670f59caf | 34 | |
emilytrembeth | 4:da63962bc0f1 | 35 | |
cgogay | 6:2ef9c06ce506 | 36 | //Main thread |
cgogay | 6:2ef9c06ce506 | 37 | int main() { |
cgogay | 6:2ef9c06ce506 | 38 | |
erolleyparnell | 11:799025124e87 | 39 | //Power On Check TODO |
emilytrembeth | 15:00422efe0550 | 40 | lcd.cls(); |
cgogay | 6:2ef9c06ce506 | 41 | |
cgogay | 6:2ef9c06ce506 | 42 | // run threads |
cgogay | 6:2ef9c06ce506 | 43 | t1.start(FunctionSensor); |
emilytrembeth | 14:433745616744 | 44 | t2.start(FunctionSerial); |
emilytrembeth | 14:433745616744 | 45 | t3.start(FunctionSD2); |
emilytrembeth | 15:00422efe0550 | 46 | t4.start(Network); |
cgogay | 6:2ef9c06ce506 | 47 | } |