Merge pull request #4369 from azolyoung/fix_rcsplitwifi_toogle_bug

fix toggle wi-fi  will cause rcsplit turnoff
This commit is contained in:
Michael Keller 2017-10-15 23:31:27 +13:00 committed by GitHub
commit 3942536012
2 changed files with 7 additions and 1 deletions

View File

@ -24,6 +24,7 @@
#include "fc/rc_controls.h"
#include "fc/rc_modes.h"
#include "fc/runtime_config.h"
#include "io/rcsplit.h"
#include "io/serial.h"
@ -82,7 +83,11 @@ static void rcSplitProcessMode(void)
uint8_t argument = RCSPLIT_CTRL_ARGU_INVALID;
switch (i) {
case BOXCAMERA1:
argument = RCSPLIT_CTRL_ARGU_WIFI_BTN;
// check whether arm unlock, we found a bug in rcsplit firmware:
// if rcsplit running without Wi-Fi module, and user try to turn on wifi, it'll cause rcsplit to turn off itself, this is danger
if (!ARMING_FLAG(ARMED)) {
argument = RCSPLIT_CTRL_ARGU_WIFI_BTN;
}
break;
case BOXCAMERA2:
argument = RCSPLIT_CTRL_ARGU_POWER_BTN;

View File

@ -423,4 +423,5 @@ extern "C" {
bool feature(uint32_t) { return false;}
void serialWriteBuf(serialPort_t *instance, const uint8_t *data, int count) { UNUSED(instance); UNUSED(data); UNUSED(count); }
uint8_t armingFlags = 0;
}