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/Task3.h@45:3847d7bf8b2c, 2014-05-17 (annotated)
- Committer:
- pHysiX
- Date:
- Sat May 17 09:12:20 2014 +0000
- Revision:
- 45:3847d7bf8b2c
- Parent:
- 44:4be5c01c6de2
- Child:
- 47:89a7077a70d3
- Child:
- 48:9dbdc4144f00
Retuned Roll PID to counter CM
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| pHysiX | 22:ef8aa9728013 | 1 | /* File: Task3.h | 
| pHysiX | 22:ef8aa9728013 | 2 | * Author: Trung Tin Ian HUA | 
| pHysiX | 22:ef8aa9728013 | 3 | * Date: May 2014 | 
| pHysiX | 22:ef8aa9728013 | 4 | * Purpose: Thread3: RC & BT Command, and Telemetry | 
| pHysiX | 22:ef8aa9728013 | 5 | * Settings: 50Hz | 
| pHysiX | 22:ef8aa9728013 | 6 | */ | 
| pHysiX | 1:43f8ac7ca6d7 | 7 | #include "mbed.h" | 
| pHysiX | 1:43f8ac7ca6d7 | 8 | #include "rtos.h" | 
| pHysiX | 1:43f8ac7ca6d7 | 9 | #include "tasks.h" | 
| pHysiX | 1:43f8ac7ca6d7 | 10 | |
| pHysiX | 1:43f8ac7ca6d7 | 11 | #ifndef _TASK3_H_ | 
| pHysiX | 1:43f8ac7ca6d7 | 12 | #define _TASKS3_H_ | 
| pHysiX | 1:43f8ac7ca6d7 | 13 | |
| pHysiX | 22:ef8aa9728013 | 14 | // ms timing: Refer to tasks.h to change frequency of Task3. | 
| pHysiX | 1:43f8ac7ca6d7 | 15 | #define TASK3_PERIOD 1000/TASK3_FREQUENCY | 
| pHysiX | 1:43f8ac7ca6d7 | 16 | |
| pHysiX | 25:a7cfe421cb4a | 17 | enum FLIGHT_MODE { | 
| pHysiX | 25:a7cfe421cb4a | 18 | RATE, | 
| pHysiX | 27:18b6580eb0b1 | 19 | ATTITUDE | 
| pHysiX | 25:a7cfe421cb4a | 20 | }; | 
| pHysiX | 25:a7cfe421cb4a | 21 | |
| pHysiX | 44:4be5c01c6de2 | 22 | extern volatile int RCCommand[5]; | 
| pHysiX | 44:4be5c01c6de2 | 23 | extern volatile int inputYPR[3]; | 
| pHysiX | 44:4be5c01c6de2 | 24 | extern volatile float ypr_offset[3]; | 
| pHysiX | 1:43f8ac7ca6d7 | 25 | |
| pHysiX | 36:d95e3d6f2fc4 | 26 | extern FLIGHT_MODE mode; | 
| pHysiX | 3:605fbcb54e75 | 27 | |
| pHysiX | 36:d95e3d6f2fc4 | 28 | extern AnalogIn voltageSense; | 
| pHysiX | 25:a7cfe421cb4a | 29 | |
| pHysiX | 22:ef8aa9728013 | 30 | /* Thread3: RC & BT Command, and Telemetry */ | 
| pHysiX | 1:43f8ac7ca6d7 | 31 | void Task3(void const *argument); | 
| pHysiX | 1:43f8ac7ca6d7 | 32 | |
| pHysiX | 33:f88a6ee18103 | 33 | // ======================== | 
| pHysiX | 33:f88a6ee18103 | 34 | // === Helper functions === | 
| pHysiX | 33:f88a6ee18103 | 35 | // ======================== | 
| pHysiX | 17:18c3bd016e49 | 36 | int constrainRCCommand(int input); | 
| pHysiX | 32:7a9be7761c46 | 37 | int deadbandInputYPR(int input); | 
| pHysiX | 45:3847d7bf8b2c | 38 | int constrainInputY(int input); | 
| pHysiX | 45:3847d7bf8b2c | 39 | int constrainInputPR(int input); | 
| pHysiX | 32:7a9be7761c46 | 40 | void uartDecoder(char input); | 
| pHysiX | 17:18c3bd016e49 | 41 | |
| pHysiX | 1:43f8ac7ca6d7 | 42 | #endif |