Quadrotor from scratch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
922 B

/* status.h */
#include "types.h"
bool status_armed(void);
void status_set_ready(unsigned int module, bool ready);
void status_set_led_pattern(unsigned int module);
void init_status(void);
#define STATUS_MODULE_CONFIG 0
#define STATUS_MODULE_GYRO_ZERO 1
#define STATUS_MODULE_GYRO_RATE 2
#define STATUS_MODULE_ATTITUDE 3
#define STATUS_MODULE_DCM_ERROR 4
#define STATUS_MODULE_STICK 5
#define STATUS_MODULES 6
#define STATUS_COUNT { \
STATUS_COUNT_CONFIG, \
STATUS_COUNT_GYRO_ZERO, \
STATUS_COUNT_GYRO_RATE, \
STATUS_COUNT_ATTITUDE, \
STATUS_COUNT_DCM_ERROR, \
STATUS_COUNT_STICK \
}
/*
* Each condition must be valid for so many samples, typically once
* per 100Hz loop
*/
#define STATUS_COUNT_CONFIG 1
#define STATUS_COUNT_STICK 100
#define STATUS_COUNT_GYRO_ZERO 1
#define STATUS_COUNT_GYRO_RATE 100
#define STATUS_COUNT_ATTITUDE 100
#define STATUS_COUNT_DCM_ERROR 100