Reboot directly into USB bootloader on Serial reset
This commit is contained in:
parent
e0e0d9e115
commit
77d7a26428
1 changed files with 3 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ extern "C" {
|
|||
#include "tusb.h"
|
||||
#include "pico/time.h"
|
||||
#include "pico/binary_info.h"
|
||||
#include "pico/bootrom.h"
|
||||
#include "hardware/irq.h"
|
||||
#include "pico/mutex.h"
|
||||
#include "hardware/watchdog.h"
|
||||
|
|
@ -227,7 +228,8 @@ static bool _rts = false;
|
|||
static int _bps = 115200;
|
||||
static void CheckSerialReset() {
|
||||
if ((_bps == 1200) && (!_dtr)) {
|
||||
watchdog_enable(100, 1);
|
||||
reset_usb_boot(0,0);
|
||||
// watchdog_enable(100, 1);
|
||||
while (1); // WDT will fire here
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue