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/Task4.h@22:ef8aa9728013, 2014-05-08 (annotated)
- Committer:
- pHysiX
- Date:
- Thu May 08 10:33:43 2014 +0000
- Revision:
- 22:ef8aa9728013
- Parent:
- 21:b642c18eccd1
- Child:
- 27:18b6580eb0b1
Commented and tidied entire code for release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pHysiX | 22:ef8aa9728013 | 1 | /* File: Task4.h |
pHysiX | 22:ef8aa9728013 | 2 | * Author: Trung Tin Ian HUA |
pHysiX | 22:ef8aa9728013 | 3 | * Date: May 2014 |
pHysiX | 22:ef8aa9728013 | 4 | * Purpose: Thread4: ESC pulsewidth update. Note this is INDEPENDENT of the pulse frequency. |
pHysiX | 22:ef8aa9728013 | 5 | * Settings: 200Hz |
pHysiX | 22:ef8aa9728013 | 6 | * 200Hz <= PWM frequency <= 400Hz |
pHysiX | 22:ef8aa9728013 | 7 | * Refer to setup.h to change PWM frequency |
pHysiX | 22:ef8aa9728013 | 8 | */ |
pHysiX | 22:ef8aa9728013 | 9 | |
pHysiX | 1:43f8ac7ca6d7 | 10 | #include "mbed.h" |
pHysiX | 1:43f8ac7ca6d7 | 11 | #include "rtos.h" |
pHysiX | 1:43f8ac7ca6d7 | 12 | #include "tasks.h" |
pHysiX | 1:43f8ac7ca6d7 | 13 | |
pHysiX | 1:43f8ac7ca6d7 | 14 | #ifndef _TASK4_H_ |
pHysiX | 1:43f8ac7ca6d7 | 15 | #define _TASK4_H_ |
pHysiX | 1:43f8ac7ca6d7 | 16 | |
pHysiX | 22:ef8aa9728013 | 17 | // ms timing: Refer to tasks.h to change frequency of Task4. |
pHysiX | 1:43f8ac7ca6d7 | 18 | #define TASK4_PERIOD 1000/TASK4_FREQUENCY |
pHysiX | 1:43f8ac7ca6d7 | 19 | |
pHysiX | 2:ab967d7b4346 | 20 | extern int ESCpower[4]; |
pHysiX | 2:ab967d7b4346 | 21 | |
pHysiX | 14:267368c83b6a | 22 | extern bool armed; |
pHysiX | 21:b642c18eccd1 | 23 | extern bool ESC_check; |
pHysiX | 21:b642c18eccd1 | 24 | extern bool calibration_mode; |
pHysiX | 14:267368c83b6a | 25 | |
pHysiX | 22:ef8aa9728013 | 26 | /* Thread4: Update ESC pulsewidth */ |
pHysiX | 1:43f8ac7ca6d7 | 27 | void Task4(void const *argument); |
pHysiX | 1:43f8ac7ca6d7 | 28 | |
pHysiX | 21:b642c18eccd1 | 29 | int constrainESC(float input); |
pHysiX | 19:bd88749c8db4 | 30 | |
pHysiX | 1:43f8ac7ca6d7 | 31 | #endif |