Skip to content

Commit

Permalink
refactor: fix reboot in bootloader
Browse files Browse the repository at this point in the history
Signed-off-by: noteolvides <[email protected]>
  • Loading branch information
Noteolvides committed Oct 16, 2023
1 parent 19d2012 commit 7782bca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/kaleidoscope/device/dygma/Defy_wireless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ void DefyHands::setup()
};
Communications.callbacks.bind(CONNECTED, checkBrightness);
Communications.callbacks.bind(DISCONNECTED, checkBrightness);
Communications.callbacks.bind(CONNECTED, ([](const Packet &) { ::LEDControl.set_mode(::LEDControl.get_mode_index()); }));



settings_interval_ = ::EEPROMSettings.requestSlice(sizeof(keyscan_interval_));
settings_base = ::EEPROMSettings.requestSlice(sizeof(DefyHands::Brightness));
Expand Down
10 changes: 7 additions & 3 deletions src/kaleidoscope/driver/bootloader/nrf/NRF.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

#ifdef NRF52_ARCH

#include "kaleidoscope/driver/bootloader/Base.h"
#include "bootloader_drv.h"
#include "Adafruit_TinyUSB.h"
#include "Arduino.h"
#include "bootloader_drv.h"
#include "kaleidoscope/driver/bootloader/Base.h"
#include "nrf_sdh.h"


namespace kaleidoscope {
Expand All @@ -16,9 +18,11 @@ namespace nrf {
class nrfBoot : public kaleidoscope::driver::bootloader::Base {
public:
static void rebootBootloader() {

TinyUSBDevice.detach();
bldrdrv_init();
bldrdrv_update_request();
delay(100);
nrf_sdh_disable_request();
reset_mcu();
}
};
Expand Down

0 comments on commit 7782bca

Please sign in to comment.