Skip to content

Commit

Permalink
ping360: set the baudrate before sending to bootloader for flash
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxzer committed Dec 20, 2023
1 parent f48765b commit 01e0568
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sensor/ping360.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ void Ping360::flash(const QString& fileUrl, bool sendPingGotoBootloader, int bau

if (sendPingGotoBootloader) {
qCDebug(PING_PROTOCOL_PING360) << "Put it in bootloader mode.";

// set the baudrate for two reasons:
// 1: if doing an auto scan, this will break the sensor out of
// automatic transmission mode
// 2: use a low baudrate to decrease chances of corruption in transmission
setBaudRate(9600);
ping360_reset m;
m.set_bootloader(1);
m.updateChecksum();
Expand Down

0 comments on commit 01e0568

Please sign in to comment.