File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 88#include " amsky01_utils.h"
99#include " config.h"
1010
11+ // RP2040 bootloader reset function
12+ extern " C" {
13+ void reset_usb_boot (uint32_t usb_activity_gpio_mask, uint32_t disable_interface_mask);
14+ }
15+
1116// Firmware and hardware version info
1217#define DEVICE_NAME " AMSKY01A"
1318#define FW_VERSION BUILD_VERSION
@@ -48,6 +53,14 @@ const unsigned long MEASUREMENT_INTERVAL = 2000; // 2 seconds
4853// Režim posílání celé IR mapy po UARTu
4954bool thrmap_streaming = false ;
5055
56+ // Enter UF2 bootloader mode
57+ static void enterUf2Bootloader () {
58+ Serial.println (" # Entering UF2 bootloader mode..." );
59+ Serial.flush ();
60+ delay (100 );
61+ reset_usb_boot (0 , 0 ); // Reset to UF2 bootloader in ROM
62+ }
63+
5164static void processSerialCommand (const char *cmd)
5265{
5366 if (strcmp (cmd, " thrmap_on" ) == 0 )
@@ -72,6 +85,10 @@ static void processSerialCommand(const char *cmd)
7285 {
7386 configManager.reset ();
7487 }
88+ else if (strcmp (cmd, " bootloader" ) == 0 )
89+ {
90+ enterUf2Bootloader ();
91+ }
7592 else if (strncmp (cmd, " set " , 4 ) == 0 )
7693 {
7794 // Parse "set <param> <value>" commands
You can’t perform that action at this time.
0 commit comments