![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Finished project.
Fork of ReferredCoursework2016 by
main.cpp@91:cd9fcd45ecf6, 2017-08-17 (annotated)
- Committer:
- J_Satchell
- Date:
- Thu Aug 17 06:58:29 2017 +0000
- Revision:
- 91:cd9fcd45ecf6
- Parent:
- 90:38dfa3f350aa
Added mutex
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
J_Satchell | 90:38dfa3f350aa | 1 | /*main.cpp*/ |
J_Satchell | 90:38dfa3f350aa | 2 | #include "mbed.h" |
J_Satchell | 90:38dfa3f350aa | 3 | #include "x_nucleo_iks01a1.h" |
J_Satchell | 90:38dfa3f350aa | 4 | #include "sensor.h" |
J_Satchell | 90:38dfa3f350aa | 5 | #include "buffer.h" |
J_Satchell | 90:38dfa3f350aa | 6 | |
J_Satchell | 90:38dfa3f350aa | 7 | Thread sensorThread; |
J_Satchell | 90:38dfa3f350aa | 8 | |
J_Satchell | 90:38dfa3f350aa | 9 | /* Simple main function that calls the required functions*/ |
J_Satchell | 90:38dfa3f350aa | 10 | int main() { |
J_Satchell | 90:38dfa3f350aa | 11 | |
J_Satchell | 90:38dfa3f350aa | 12 | printf("\r\n--- Starting new run ---\r\n"); |
J_Satchell | 90:38dfa3f350aa | 13 | |
J_Satchell | 90:38dfa3f350aa | 14 | wait(3); |
J_Satchell | 91:cd9fcd45ecf6 | 15 | |
J_Satchell | 91:cd9fcd45ecf6 | 16 | sensorThread.start(sensor_run); |
J_Satchell | 91:cd9fcd45ecf6 | 17 | Thread::wait(0.1); |
J_Satchell | 91:cd9fcd45ecf6 | 18 | |
J_Satchell | 90:38dfa3f350aa | 19 | while (1) { |
J_Satchell | 91:cd9fcd45ecf6 | 20 | |
J_Satchell | 90:38dfa3f350aa | 21 | print_averages(); |
J_Satchell | 90:38dfa3f350aa | 22 | |
J_Satchell | 91:cd9fcd45ecf6 | 23 | Thread::wait(0.1); |
J_Satchell | 90:38dfa3f350aa | 24 | } |
noutram | 89:c55aa4c1187f | 25 | |
noutram | 89:c55aa4c1187f | 26 | |
noutram | 89:c55aa4c1187f | 27 | } |