Version 5

Dependencies:   BMP280 TextLCD BME280

Committer:
O_Thom
Date:
Sun Nov 25 17:49:47 2018 +0000
Revision:
2:38d31b2e0956
Parent:
0:f9a18207d99c
Child:
4:740cba3f2716
Inclusion of the mail queue code - Single queue added. Multiple to be added later to route to the LCD, Networking, Serial Port, etc. threads.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
O_Thom 0:f9a18207d99c 1 /* Sampling Code */
O_Thom 0:f9a18207d99c 2 #include "mbed.h"
O_Thom 0:f9a18207d99c 3 #include "sample_hardware.hpp"
O_Thom 0:f9a18207d99c 4 #include "Sampler.hpp"
O_Thom 0:f9a18207d99c 5
O_Thom 0:f9a18207d99c 6 EventQueue mainQueue;
O_Thom 0:f9a18207d99c 7
O_Thom 0:f9a18207d99c 8 Sampler s; // Initialise the s object
O_Thom 2:38d31b2e0956 9 Ticker t; // Time Initialisation
O_Thom 2:38d31b2e0956 10
O_Thom 2:38d31b2e0956 11 void doISR()
O_Thom 2:38d31b2e0956 12 {
O_Thom 2:38d31b2e0956 13 s.activate(); // Signal the sampling thread to move from WAITING to READY
O_Thom 2:38d31b2e0956 14 }
O_Thom 2:38d31b2e0956 15
O_Thom 0:f9a18207d99c 16
O_Thom 0:f9a18207d99c 17 int main()
O_Thom 0:f9a18207d99c 18 {
O_Thom 2:38d31b2e0956 19 t.attach(&doISR, 15);
O_Thom 0:f9a18207d99c 20 Thread::wait(osWaitForever);
O_Thom 0:f9a18207d99c 21 }
O_Thom 2:38d31b2e0956 22