Skip to content

Commit 62c82ae

Browse files
committed
change delay in setTransmit
only delay if we have sent device information. This seems to help with iNAV
1 parent 119f341 commit 62c82ae

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

Inc/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
update this file for new releases
33
*/
44

5-
#define BOOTLOADER_VERSION 15
5+
#define BOOTLOADER_VERSION 16
66

77

88

bootloader/main.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static char receiveByte;
201201
static bool messagereceived;
202202
static int cmd;
203203
static int received;
204-
204+
static bool initialized;
205205
static uint8_t rxBuffer[258];
206206
static uint8_t payLoadBuffer[256];
207207
static uint8_t rxbyte;
@@ -342,7 +342,11 @@ static void setTransmit()
342342
gpio_mode_set_output(input_pin, GPIO_OUTPUT_PUSH_PULL);
343343

344344
// delay a bit to let the sender get setup for receiving
345-
delayMicroseconds(BITTIME);
345+
// only delay if device info has been sent, this prevents
346+
// an issue with iNAV
347+
if (initialized){
348+
delayMicroseconds(BITTIME);
349+
}
346350
}
347351

348352
static void serialwriteOneChar(uint8_t c)
@@ -373,6 +377,7 @@ static void send_BAD_CRC_ACK()
373377
static void sendDeviceInfo()
374378
{
375379
sendString(devinfo.deviceInfo,sizeof(devinfo.deviceInfo));
380+
initialized = true;
376381
}
377382

378383
static bool checkAddressWritable(uint32_t address)
@@ -961,7 +966,7 @@ int main(void)
961966

962967
checkForSignal();
963968

964-
gpio_mode_set_input(input_pin, GPIO_PULL_NONE);
969+
gpio_mode_set_input(input_pin, GPIO_PULL_UP);
965970

966971
#ifdef USE_ADC_INPUT // go right to application
967972
jump();

0 commit comments

Comments
 (0)