mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +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:
Submodule protobufs updated: 8e84c2f95f...4a1d3766e8
@@ -77,7 +77,7 @@ extern int heltec_version;
|
|||||||
// This will suppress the current delay and instead try to run ASAP.
|
// This will suppress the current delay and instead try to run ASAP.
|
||||||
extern bool runASAP;
|
extern bool runASAP;
|
||||||
|
|
||||||
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), rp2040Setup(), clearBonds();
|
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), rp2040Setup(), clearBonds(), enterDfuMode();
|
||||||
|
|
||||||
meshtastic_DeviceMetadata getDeviceMetadata();
|
meshtastic_DeviceMetadata getDeviceMetadata();
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ typedef struct _meshtastic_AdminMessage {
|
|||||||
bool get_node_remote_hardware_pins_request;
|
bool get_node_remote_hardware_pins_request;
|
||||||
/* Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use */
|
/* Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use */
|
||||||
meshtastic_NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response;
|
meshtastic_NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response;
|
||||||
/* Enter (serial) DFU mode
|
/* Enter (UF2) DFU mode
|
||||||
Only implemented on NRF52 currently */
|
Only implemented on NRF52 currently */
|
||||||
bool enter_dfu_mode_request;
|
bool enter_dfu_mode_request;
|
||||||
/* Set the owner for this node */
|
/* Set the owner for this node */
|
||||||
|
|||||||
@@ -188,6 +188,13 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
reboot(DEFAULT_REBOOT_SECONDS);
|
reboot(DEFAULT_REBOOT_SECONDS);
|
||||||
break;
|
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
|
#ifdef ARCH_PORTDUINO
|
||||||
case meshtastic_AdminMessage_exit_simulator_tag:
|
case meshtastic_AdminMessage_exit_simulator_tag:
|
||||||
LOG_INFO("Exiting simulator\n");
|
LOG_INFO("Exiting simulator\n");
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include <Adafruit_TinyUSB.h>
|
||||||
#include <Adafruit_nRFCrypto.h>
|
#include <Adafruit_nRFCrypto.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
@@ -215,3 +216,8 @@ void clearBonds()
|
|||||||
}
|
}
|
||||||
nrf52Bluetooth->clearBonds();
|
nrf52Bluetooth->clearBonds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void enterDfuMode()
|
||||||
|
{
|
||||||
|
enterUf2Dfu();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user