Ian Hua / Quadcopter-mbedRTOS
Committer:
pHysiX
Date:
Mon May 12 13:49:43 2014 +0000
Revision:
33:f88a6ee18103
Parent:
30:d9b988f8d84f
Child:
44:4be5c01c6de2
Tidied code

Who changed what in which revision?

UserRevisionLine numberNew 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 27:18b6580eb0b1 7 * Refer to tasks.h to change PWM frequency
pHysiX 22:ef8aa9728013 8 */
pHysiX 1:43f8ac7ca6d7 9 #include "mbed.h"
pHysiX 1:43f8ac7ca6d7 10 #include "rtos.h"
pHysiX 1:43f8ac7ca6d7 11 #include "tasks.h"
pHysiX 1:43f8ac7ca6d7 12
pHysiX 1:43f8ac7ca6d7 13 #ifndef _TASK4_H_
pHysiX 1:43f8ac7ca6d7 14 #define _TASK4_H_
pHysiX 1:43f8ac7ca6d7 15
pHysiX 22:ef8aa9728013 16 // ms timing: Refer to tasks.h to change frequency of Task4.
pHysiX 1:43f8ac7ca6d7 17 #define TASK4_PERIOD 1000/TASK4_FREQUENCY
pHysiX 1:43f8ac7ca6d7 18
pHysiX 2:ab967d7b4346 19 extern int ESCpower[4];
pHysiX 2:ab967d7b4346 20
pHysiX 14:267368c83b6a 21 extern bool armed;
pHysiX 21:b642c18eccd1 22 extern bool ESC_check;
pHysiX 21:b642c18eccd1 23 extern bool calibration_mode;
pHysiX 14:267368c83b6a 24
pHysiX 22:ef8aa9728013 25 /* Thread4: Update ESC pulsewidth */
pHysiX 1:43f8ac7ca6d7 26 void Task4(void const *argument);
pHysiX 1:43f8ac7ca6d7 27
pHysiX 33:f88a6ee18103 28 // ========================
pHysiX 33:f88a6ee18103 29 // === Helper functions ===
pHysiX 33:f88a6ee18103 30 // ========================
pHysiX 21:b642c18eccd1 31 int constrainESC(float input);
pHysiX 19:bd88749c8db4 32
pHysiX 1:43f8ac7ca6d7 33 #endif