30 #define PERIODIC_C_MAIN
32 #pragma GCC diagnostic push
33 #pragma GCC diagnostic ignored "-Wunused-parameter"
34 #include "generated/periodic_telemetry.h"
35 #pragma GCC diagnostic pop
37 #include "generated/airframe.h"
38 #include "generated/settings.h"
77 for (i = 0; i < ACTUATORS_NB; i++) {
105 #define IdOfMsg(x) (x[1])
110 if (msg_id == DL_SET_ACTUATOR) {
112 uint16_t actuator_value __attribute__((unused)) = DL_SET_ACTUATOR_value(
dl_buffer);
119 switch (actuator_no) {
121 case 0: ActuatorSet(0, actuator_value);
break;
124 case 1: ActuatorSet(1, actuator_value);
break;
127 case 2: ActuatorSet(2, actuator_value);
break;
130 case 3: ActuatorSet(3, actuator_value);
break;
133 case 4: ActuatorSet(4, actuator_value);
break;
136 case 5: ActuatorSet(5, actuator_value);
break;
139 case 6: ActuatorSet(6, actuator_value);
break;
142 case 7: ActuatorSet(7, actuator_value);
break;
145 case 8: ActuatorSet(8, actuator_value);
break;
155 else if (msg_id == DL_SETTING && DL_SETTING_ac_id(
dl_buffer) == AC_ID) {
162 ActuatorSet(0, actuators[SERVO_0_IDX]);
165 ActuatorSet(1, actuators[SERVO_1_IDX]);
168 ActuatorSet(2, actuators[SERVO_2_IDX]);
171 ActuatorSet(3, actuators[SERVO_3_IDX]);
174 ActuatorSet(4, actuators[SERVO_4_IDX]);
177 ActuatorSet(5, actuators[SERVO_5_IDX]);
180 ActuatorSet(6, actuators[SERVO_6_IDX]);
183 ActuatorSet(7, actuators[SERVO_7_IDX]);
186 ActuatorSet(8, actuators[SERVO_8_IDX]);
190 }
else if (msg_id == DL_GET_SETTING && DL_GET_SETTING_ac_id(
dl_buffer) == AC_ID) {
192 float val = settings_get_value(i);
void mcu_init(void)
Microcontroller peripherals initialization.
Handling of messages coming from ground and other A/Cs.
static void main_event(void)
Hardware independent API for actuators (servos, motor controllers).
Architecture independent timing functions.
#define DefaultChannel
SITL.
Arch independent mcu ( Micro Controller Unit ) utilities.
static void main_periodic(void)
void dl_parse_msg(void)
Should be called when chars are available in dl_buffer.
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
static void main_init(void)
Common code for AP and FBW telemetry.
uint8_t dl_buffer[MSG_SIZE]
arch independent LED (Light Emitting Diodes) API
void mcu_event(void)
MCU event functions.
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.