mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 09:06:02 +00:00
Implemented enter (Uf2 usb) DFU mode admin message on NRF52 (#3045)
* Added enter DFU mode admin message * Trunk
This commit is contained in:
parent
2b7eb1e489
commit
dbac2b1cad
@ -1 +1 @@
|
||||
Subproject commit 8e84c2f95fcc7f0e88a80645d3a88812adbda841
|
||||
Subproject commit 4a1d3766e888d3dd7d1acda817083295fb054c92
|
@ -77,7 +77,7 @@ extern int heltec_version;
|
||||
// This will suppress the current delay and instead try to run ASAP.
|
||||
extern bool runASAP;
|
||||
|
||||
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), rp2040Setup(), clearBonds();
|
||||
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), rp2040Setup(), clearBonds(), enterDfuMode();
|
||||
|
||||
meshtastic_DeviceMetadata getDeviceMetadata();
|
||||
|
||||
|
@ -131,7 +131,7 @@ typedef struct _meshtastic_AdminMessage {
|
||||
bool get_node_remote_hardware_pins_request;
|
||||
/* Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use */
|
||||
meshtastic_NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response;
|
||||
/* Enter (serial) DFU mode
|
||||
/* Enter (UF2) DFU mode
|
||||
Only implemented on NRF52 currently */
|
||||
bool enter_dfu_mode_request;
|
||||
/* Set the owner for this node */
|
||||
|
@ -188,6 +188,13 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
reboot(DEFAULT_REBOOT_SECONDS);
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_enter_dfu_mode_request_tag: {
|
||||
LOG_INFO("Client is requesting to enter DFU mode.\n");
|
||||
#ifdef ARCH_NRF52
|
||||
enterDfuMode();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#ifdef ARCH_PORTDUINO
|
||||
case meshtastic_AdminMessage_exit_simulator_tag:
|
||||
LOG_INFO("Exiting simulator\n");
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "configuration.h"
|
||||
#include <Adafruit_TinyUSB.h>
|
||||
#include <Adafruit_nRFCrypto.h>
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
@ -215,3 +216,8 @@ void clearBonds()
|
||||
}
|
||||
nrf52Bluetooth->clearBonds();
|
||||
}
|
||||
|
||||
void enterDfuMode()
|
||||
{
|
||||
enterUf2Dfu();
|
||||
}
|
Loading…
Reference in New Issue
Block a user