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.
RTOS-Threads/inc/Task2_Master.h@44:4be5c01c6de2, 2014-05-16 (annotated)
- Committer:
- pHysiX
- Date:
- Fri May 16 23:34:20 2014 +0000
- Revision:
- 44:4be5c01c6de2
- Parent:
- 38:ef65533cca32
- Child:
- 47:89a7077a70d3
- Child:
- 50:8a0accb23007
Changed a few variables that were not declared volatile but are accessed by multiple threads
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| pHysiX | 27:18b6580eb0b1 | 1 | /* File: Task2_Master.h | 
| pHysiX | 27:18b6580eb0b1 | 2 | * Author: Trung Tin Ian HUA | 
| pHysiX | 27:18b6580eb0b1 | 3 | * Date: May 2014 | 
| pHysiX | 36:d95e3d6f2fc4 | 4 | * Purpose: Thread2M: Master PID control loop (attitude) | 
| pHysiX | 36:d95e3d6f2fc4 | 5 | * Functions: AHRSSample: Read MPU6050 DMP and calculate YPR | 
| pHysiX | 36:d95e3d6f2fc4 | 6 | * Settings: 200Hz | 
| pHysiX | 36:d95e3d6f2fc4 | 7 | */ | 
| pHysiX | 27:18b6580eb0b1 | 8 | #include "mbed.h" | 
| pHysiX | 27:18b6580eb0b1 | 9 | #include "rtos.h" | 
| pHysiX | 27:18b6580eb0b1 | 10 | #include "tasks.h" | 
| pHysiX | 27:18b6580eb0b1 | 11 | |
| pHysiX | 27:18b6580eb0b1 | 12 | #ifndef _TASK2_MASTER_H_ | 
| pHysiX | 27:18b6580eb0b1 | 13 | #define _TASK2_MASTER_H_ | 
| pHysiX | 27:18b6580eb0b1 | 14 | |
| pHysiX | 29:6c03b30b59ec | 15 | // ms timing: Refer to tasks.h to change frequency of Task2_Master. | 
| pHysiX | 38:ef65533cca32 | 16 | #define TASK2_MASTER_PERIOD 1000/TASK2_MASTER_FREQUENCY | 
| pHysiX | 27:18b6580eb0b1 | 17 | |
| pHysiX | 36:d95e3d6f2fc4 | 18 | |
| pHysiX | 36:d95e3d6f2fc4 | 19 | #ifdef ENABLE_COMPASS | 
| pHysiX | 36:d95e3d6f2fc4 | 20 | extern double heading; | 
| pHysiX | 36:d95e3d6f2fc4 | 21 | #endif | 
| pHysiX | 36:d95e3d6f2fc4 | 22 | |
| pHysiX | 38:ef65533cca32 | 23 | extern volatile float ypr[3]; | 
| pHysiX | 27:18b6580eb0b1 | 24 | extern volatile float adjust_attitude[3]; | 
| pHysiX | 27:18b6580eb0b1 | 25 | |
| pHysiX | 27:18b6580eb0b1 | 26 | /* Thread2-Master: Attitude PID Control */ | 
| pHysiX | 27:18b6580eb0b1 | 27 | void Task2_Master(void const *argument); | 
| pHysiX | 27:18b6580eb0b1 | 28 | |
| pHysiX | 36:d95e3d6f2fc4 | 29 | // ======================== | 
| pHysiX | 36:d95e3d6f2fc4 | 30 | // === Helper functions === | 
| pHysiX | 36:d95e3d6f2fc4 | 31 | // ======================== | 
| pHysiX | 36:d95e3d6f2fc4 | 32 | void AHRSSample(void); | 
| pHysiX | 36:d95e3d6f2fc4 | 33 | |
| pHysiX | 27:18b6580eb0b1 | 34 | #endif |