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-18
- Revision:
- 47:89a7077a70d3
- Parent:
- 45:3847d7bf8b2c
File content as of revision 47:89a7077a70d3:
/* 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 volatile int RCCommand[5];
extern volatile int inputYPR[3];
extern volatile 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, int axis);
void uartDecoder(char input);
#endif