Ian Hua / Quadcopter-mbedRTOS

RTOS-Threads/inc/Task3.h

Committer:
pHysiX
Date:
2014-05-08
Revision:
25:a7cfe421cb4a
Parent:
22:ef8aa9728013
Child:
27:18b6580eb0b1

File content as of revision 25:a7cfe421cb4a:

/* File:        Task3.h
 * Author:      Trung Tin Ian HUA
 * Date:        May 2014
 * Purpose:     Thread3: RC & BT Command, and Telemetry
 * Settings:    50Hz
 */ 

#include "mbed.h"
#include "rtos.h"
#include "tasks.h"

#ifndef _TASK3_H_
#define _TASKS3_H_

// ms timing: Refer to tasks.h to change frequency of Task3.
#define TASK3_PERIOD 1000/TASK3_FREQUENCY

/* Scale:
Vin = ADC * Vread * scale
Vin = (2^n-1)/3.3 * k*Vin * scale * ADJUST
*/
#define VOLTAGE_SCALE 49.60248447

//typedef enum {
enum FLIGHT_MODE {
    RATE,
    STABLE
};

extern float ypr_offset[3];

extern bool box_demo;
extern bool rc_out;
extern bool gyro_out;
extern bool command_check;
extern bool adjust_check;

extern int RCCommand[5];
extern int inputYPR[3];

extern FLIGHT_MODE mode;

/* Thread3: RC & BT Command, and Telemetry */
void Task3(void const *argument);

int constrainRCCommand(int input);

#endif