-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathosHandles.h
executable file
·62 lines (51 loc) · 1.43 KB
/
osHandles.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef OSHANDLES_H
#define OSHANDLES_H
#include "./FreeRTOS/FreeRTOS.h" // Includes for RTOS & Other services provided by it:
#include "./FreeRTOS/task.h"
#include "./FreeRTOS/queue.h"
#include "./FreeRTOS/semphr.h"
#include "./drivers/pid.h"
//#include <stdint.h>
typedef unsigned int uint32_t;
typedef signed int int32_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned char uint8_t;
typedef signed char int8_t;
//used for osHandles->flight_settings.flying_mode
#define X_MODE 0
#define PLUS_MODE 1
// A pointer to OSHANDLES is all that is needed for any file/task to access
// Semaphores, task handles, queue handles etc...
// Pointer can be passed to task as pvParameter
typedef struct
{
struct {
//xQueueHandle playback_playlist;
}queue;
struct {
xTaskHandle userInterface;
xTaskHandle flight_task;
xTaskHandle led_task;
}task;
struct {
xSemaphoreHandle SPI; // spi lock
}lock;
struct {
PID_DATA * pid_roll;
PID_DATA * pid_pitch;
PID_DATA * pid_yaw;
uint8_t flying_mode; //X_MODE or PLUS_MODE
uint8_t led_mode;
uint16_t pitch_roll_tx_scale;
uint16_t yaw_tx_scale;
}flight_settings;
struct {
unsigned char armed;
unsigned char telem_mode;
int tx_throttle, tx_yaw, tx_pitch, tx_roll;
unsigned int command_used_number;
unsigned char please_update_sensors;
}flight_control;
}OSHANDLES;
#endif /* COMMONDEFS_H_ */