Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: RTOS-Threads/src/Task2_Master.cpp
- Revision:
- 51:04c6af4319e1
- Parent:
- 50:8a0accb23007
--- a/RTOS-Threads/src/Task2_Master.cpp Mon May 19 14:16:47 2014 +0000
+++ b/RTOS-Threads/src/Task2_Master.cpp Mon May 19 15:30:05 2014 +0000
@@ -32,6 +32,8 @@
double heading = 0;
#endif
+float altitude, temperature;
+
/* YPR Adjust */
volatile float adjust_attitude[3] = {0.0, 0.0, 0.0};
@@ -44,8 +46,15 @@
void Task2_Master(void const *argument)
{
while(1) {
+ //PC.printf("T2M\n");
sem_Task2_Master.wait();
+ //PC.printf("T2M Sem\n");
+
+ mutex_i2c.lock();
AHRSSample();
+ altitude = altimeter.Altitude_m();
+ altimeter.Temp_C();
+ mutex_i2c.unlock();
if (armed) {
switch (mode) {
@@ -68,6 +77,7 @@
break;
}
}
+ Thread::wait(TASK2_MASTER_PERIOD);
}
}
@@ -79,6 +89,7 @@
// ************************
void Task2_Master_ISR(void const *argument)
{
+ //PC.printf("T2M ISR\n");
sem_Task2_Master.release();
}