1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 09:16:07 +03:00

remove serial 4way change

This commit is contained in:
Thorsten Laux 2019-08-03 07:13:54 +02:00
parent 835a5cac0e
commit 3d6e62cb54

View file

@ -31,13 +31,10 @@
#ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
#include "drivers/buf_writer.h"
#include "drivers/pwm_output.h"
#include "drivers/dshot.h"
#include "drivers/dshot_dpwm.h"
#include "drivers/io.h"
#include "drivers/serial.h"
#include "drivers/time.h"
#include "drivers/timer.h"
#include "drivers/pwm_output.h"
#include "drivers/light_led.h"
#include "flight/mixer.h"
@ -79,9 +76,9 @@
// *** change to adapt Revision
#define SERIAL_4WAY_VER_MAIN 20
#define SERIAL_4WAY_VER_SUB_1 (uint8_t) 0
#define SERIAL_4WAY_VER_SUB_2 (uint8_t) 04
#define SERIAL_4WAY_VER_SUB_2 (uint8_t) 03
#define SERIAL_4WAY_PROTOCOL_VER 108
#define SERIAL_4WAY_PROTOCOL_VER 107
// *** end
#if (SERIAL_4WAY_VER_MAIN > 24)
@ -142,6 +139,7 @@ uint8_t esc4wayInit(void)
// StopPwmAllMotors();
// XXX Review effect of motor refactor
//pwmDisableMotors();
motorDisable();
escCount = 0;
memset(&escHardware, 0, sizeof(escHardware));
pwmOutputPort_t *pwmMotors = pwmGetMotors();
@ -155,7 +153,6 @@ uint8_t esc4wayInit(void)
}
}
}
motorDisable();
return escCount;
}
@ -569,13 +566,9 @@ void esc4wayProcess(serialPort_t *mspPort)
case cmd_DeviceReset:
{
bool rebootEsc = false;
if (ParamBuf[0] < escCount) {
// Channel may change here
selected_esc = ParamBuf[0];
if (ioMem.D_FLASH_ADDR_L == 1) {
rebootEsc = true;
}
}
else {
ACK_OUT = ACK_I_INVALID_CHANNEL;
@ -589,14 +582,6 @@ void esc4wayProcess(serialPort_t *mspPort)
case imARM_BLB:
{
BL_SendCMDRunRestartBootloader(&DeviceInfo);
if (rebootEsc) {
ESC_OUTPUT;
setEscLo(selected_esc);
timeMs_t m = millis();
while (millis() - m < 300);
setEscHi(selected_esc);
ESC_INPUT;
}
break;
}
#endif