Ian Hua / Quadcopter-mbedRTOS

RTOS-Threads/inc/Task4.h

Committer:
pHysiX
Date:
2014-05-12
Revision:
33:f88a6ee18103
Parent:
30:d9b988f8d84f
Child:
44:4be5c01c6de2

File content as of revision 33:f88a6ee18103:

/* File:        Task4.h
 * Author:      Trung Tin Ian HUA
 * Date:        May 2014
 * Purpose:     Thread4: ESC pulsewidth update. Note this is INDEPENDENT of the pulse frequency.
 * Settings:    200Hz
 * 200Hz <= PWM frequency <= 400Hz
 * Refer to tasks.h to change PWM frequency 
 */ 
#include "mbed.h"
#include "rtos.h"
#include "tasks.h"

#ifndef _TASK4_H_
#define _TASK4_H_

// ms timing: Refer to tasks.h to change frequency of Task4.
#define TASK4_PERIOD 1000/TASK4_FREQUENCY

extern int ESCpower[4];

extern bool armed;
extern bool ESC_check;
extern bool calibration_mode;

/* Thread4: Update ESC pulsewidth */
void Task4(void const *argument);

// ========================
// === Helper functions ===
// ========================
int constrainESC(float input);

#endif