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/Task3.h
- Committer:
 - pHysiX
 - Date:
 - 2014-05-13
 - Revision:
 - 38:ef65533cca32
 - Parent:
 - 36:d95e3d6f2fc4
 - Child:
 - 44:4be5c01c6de2
 
File content as of revision 38:ef65533cca32:
/* 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
enum FLIGHT_MODE {
    RATE,
    ATTITUDE
};
extern int RCCommand[5];
extern int inputYPR[3];
extern float ypr_offset[3];
extern FLIGHT_MODE mode;
extern AnalogIn voltageSense;
/* Thread3: RC & BT Command, and Telemetry */
void Task3(void const *argument);
// ========================
// === Helper functions ===
// ========================
int constrainRCCommand(int input);
int deadbandInputYPR(int input);
int constrainInputYPR(int input);
void uartDecoder(char input);
#endif