Skip to content

Commit

Permalink
make rx_aux_on a macro
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Aug 13, 2023
1 parent 60bdd83 commit 3a89cff
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/flight/imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdint.h>
#include <stdlib.h>

#include "core/profile.h"
#include "core/project.h"
#include "driver/time.h"
#include "flight/control.h"
Expand Down
4 changes: 2 additions & 2 deletions src/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void pid_precalc() {
}

// (iwindup = 0 windup is not allowed) (iwindup = 1 windup is allowed)
static float pid_compute_iterm_windup(uint8_t x, float pid_output) {
static inline float pid_compute_iterm_windup(uint8_t x, float pid_output) {
const float *out_limit = target.brushless ? out_limit_brushless : out_limit_brushed;
if ((pid_output >= out_limit[x]) && (state.error.axis[x] > 0)) {
return 0.0f;
Expand Down Expand Up @@ -157,7 +157,7 @@ static float pid_compute_iterm_windup(uint8_t x, float pid_output) {
return 1.0f;
}

static float pid_filter_dterm(uint8_t x, float dterm) {
static inline float pid_filter_dterm(uint8_t x, float dterm) {
dterm = filter_step(profile.filter.dterm[0].type, &filter[0], &filter_state[0][x], dterm);
dterm = filter_step(profile.filter.dterm[1].type, &filter[1], &filter_state[1][x], dterm);

Expand Down
3 changes: 2 additions & 1 deletion src/io/buzzer.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#include "io/buzzer.h"

#include "core/profile.h"
#include "core/project.h"
#include "driver/gpio.h"
#include "driver/time.h"
Expand Down Expand Up @@ -39,7 +40,7 @@ void buzzer_init() {
gpio_init.mode = GPIO_OUTPUT;
gpio_init.output = GPIO_PUSHPULL;
gpio_init.pull = GPIO_NO_PULL;
gpio_pin_init( target.buzzer.pin, gpio_init);
gpio_pin_init(target.buzzer.pin, gpio_init);

buzzer_off();
}
Expand Down
4 changes: 0 additions & 4 deletions src/rx/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ static uint32_t frames_received = 0;
static filter_lp_pt2 rx_filter;
static filter_state_t rx_filter_state[4];

uint8_t rx_aux_on(aux_function_t function) {
return state.aux[profile.receiver.aux[function]];
}

void rx_lqi_lost_packet() {
frames_missed++;

Expand Down
2 changes: 1 addition & 1 deletion src/rx/rx.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef enum {
AUX_FUNCTION_MAX
} __attribute__((__packed__)) aux_function_t;

uint8_t rx_aux_on(aux_function_t function);
#define rx_aux_on(function) (state.aux[profile.receiver.aux[function]])

void rx_init();
void rx_update();
Expand Down

0 comments on commit 3a89cff

Please sign in to comment.