Ian Hua / Quadcopter-mbedRTOS
Committer:
pHysiX
Date:
Mon May 19 16:05:11 2014 +0000
Revision:
54:a36d39a90c21
Parent:
51:04c6af4319e1
PwmInRC library, removed mutex

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 44:4be5c01c6de2 19 extern volatile 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 50:8a0accb23007 25 extern Semaphore sem_Task4;
pHysiX 50:8a0accb23007 26
pHysiX 22:ef8aa9728013 27 /* Thread4: Update ESC pulsewidth */
pHysiX 1:43f8ac7ca6d7 28 void Task4(void const *argument);
pHysiX 1:43f8ac7ca6d7 29
pHysiX 33:f88a6ee18103 30 // ========================
pHysiX 33:f88a6ee18103 31 // === Helper functions ===
pHysiX 33:f88a6ee18103 32 // ========================
pHysiX 21:b642c18eccd1 33 int constrainESC(float input);
pHysiX 19:bd88749c8db4 34
pHysiX 1:43f8ac7ca6d7 35 #endif