Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,14 @@ static void data_init(Data *d) {
alert_tracker_init(&d->alert_tracker);
reverse_stop_init(&d->reverse_stop);

// Must run before leds_setup(): beeper_init() configures VESC_PIN_PPM as a GPIO
// output, which on some hardware is the same pad as LED_PIN_B6. Whichever is
// configured last owns the pin, so the LED driver has to come second.
if ((d->float_conf.is_beeper_enabled) ||
(d->float_conf.inputtilt_remote_type != INPUTTILT_PPM)) {
beeper_init();
}

leds_init(&d->leds);
leds_setup(&d->leds, &d->float_conf.hardware.leds, &d->float_conf.leds);
lcm_init(&d->lcm, &d->float_conf.hardware.leds);
Expand Down Expand Up @@ -2689,11 +2697,6 @@ INIT_FUN(lib_info *info) {
&d->motor, d->float_conf.tiltback_lv, d->float_conf.tiltback_hv
);

if ((d->float_conf.is_beeper_enabled) ||
(d->float_conf.inputtilt_remote_type != INPUTTILT_PPM)) {
beeper_init();
}

d->main_thread = VESC_IF->spawn(refloat_thd, 1536, "Refloat Main", d);
if (!d->main_thread) {
log_error("Failed to spawn Refloat Main thread.");
Expand Down
Loading