mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Removing Brushed ESC auto detect (#12479)
- minimise pin "activation" on init.
This commit is contained in:
parent
e957f0dfa6
commit
80e9cfb998
7 changed files with 3 additions and 134 deletions
|
@ -63,7 +63,6 @@
|
|||
#include "drivers/nvic.h"
|
||||
#include "drivers/persistent.h"
|
||||
#include "drivers/pin_pull_up_down.h"
|
||||
#include "drivers/pwm_esc_detect.h"
|
||||
#include "drivers/pwm_output.h"
|
||||
#include "drivers/rx/rx_pwm.h"
|
||||
#include "drivers/sensor.h"
|
||||
|
@ -280,20 +279,6 @@ void init(void)
|
|||
targetConfiguration();
|
||||
#endif
|
||||
|
||||
#if defined(USE_BRUSHED_ESC_AUTODETECT)
|
||||
// Opportunistically use the first motor pin of the default configuration for detection.
|
||||
// We are doing this as with some boards, timing seems to be important, and the later detection will fail.
|
||||
#if defined(MOTOR1_PIN)
|
||||
ioTag_t motorIoTag = IO_TAG(MOTOR1_PIN);
|
||||
#else
|
||||
ioTag_t motorIoTag = IO_TAG_NONE;
|
||||
#endif
|
||||
|
||||
if (motorIoTag) {
|
||||
detectBrushedESC(motorIoTag);
|
||||
}
|
||||
#endif
|
||||
|
||||
enum {
|
||||
FLASH_INIT_ATTEMPTED = (1 << 0),
|
||||
SD_INIT_ATTEMPTED = (1 << 1),
|
||||
|
@ -417,15 +402,6 @@ void init(void)
|
|||
dbgPinInit();
|
||||
#endif
|
||||
|
||||
#if defined(USE_BRUSHED_ESC_AUTODETECT)
|
||||
// Now detect again with the actually configured pin for motor 1, if it is not the default pin.
|
||||
ioTag_t configuredMotorIoTag = motorConfig()->dev.ioTags[0];
|
||||
|
||||
if (configuredMotorIoTag && configuredMotorIoTag != motorIoTag) {
|
||||
detectBrushedESC(configuredMotorIoTag);
|
||||
}
|
||||
#endif
|
||||
|
||||
debugMode = systemConfig()->debug_mode;
|
||||
|
||||
#ifdef TARGET_PREINIT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue