Skip to content

Commit 6ea1ef6

Browse files
AlkaMotorstridge
authored andcommitted
change delay in setTransmit
only delay if we have sent device information. This seems to help with iNAV
1 parent 119f341 commit 6ea1ef6

2 files changed

Lines changed: 10 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: 9 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)
@@ -947,6 +952,7 @@ int main(void)
947952
{
948953
bl_clock_config();
949954
bl_timer_init();
955+
delayMicroseconds(50000);
950956
bl_gpio_init();
951957

952958
#ifdef BOOTLOADER_TEST_CLOCK
@@ -961,7 +967,7 @@ int main(void)
961967

962968
checkForSignal();
963969

964-
gpio_mode_set_input(input_pin, GPIO_PULL_NONE);
970+
gpio_mode_set_input(input_pin, GPIO_PULL_UP);
965971

966972
#ifdef USE_ADC_INPUT // go right to application
967973
jump();

0 commit comments

Comments
 (0)