Skip to content

Commit

Permalink
Merge pull request #1444 from bitcraze/tobba/esc_sleep_timeout_fix
Browse files Browse the repository at this point in the history
Added ESC bootloader wakeup signal.
  • Loading branch information
ataffanel authored Jan 21, 2025
2 parents 59fa2f6 + 0a9150d commit 3d316cc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/modules/src/serial_4way.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#define USE_SERIAL_4WAY_BLHELI_BOOTLOADER
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE

//FreeRTOS includes
#include "FreeRTOS.h"
#include "task.h"

#include "motors.h"
#include "usec_time.h"
#include "led.h"
Expand Down Expand Up @@ -153,6 +157,18 @@ uint8_t esc4wayInit(void)
escCount++;
}

// Let ESCs enter bootloader mode
vTaskDelay(M2T(200));

// Make them stay in bootloader mode.
for (volatile uint8_t i = 0; i < NBR_OF_MOTORS; i++) {
motorsESCSetOutput(i);
motorsESCSetLo(i);
vTaskDelay(M2T(1));
motorsESCSetInput(i);
motorsESCSetHi(i);
}

return escCount;
}

Expand Down

0 comments on commit 3d316cc

Please sign in to comment.