Soft Reset via Serial or post-kill button click (#21652)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@ -133,6 +133,8 @@ uint8_t HAL_get_reset_source() {
|
||||
;
|
||||
}
|
||||
|
||||
void HAL_reboot() { NVIC_SystemReset(); }
|
||||
|
||||
void _delay_ms(const int delay_ms) { delay(delay_ms); }
|
||||
|
||||
extern "C" {
|
||||
@ -147,8 +149,8 @@ extern "C" {
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRead(adc_pin); }
|
||||
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
|
||||
|
||||
// Reset the system (to initiate a firmware flash)
|
||||
void flashFirmware(const int16_t) { NVIC_SystemReset(); }
|
||||
// Reset the system to initiate a firmware flash
|
||||
void flashFirmware(const int16_t) { HAL_reboot(); }
|
||||
|
||||
// Maple Compatibility
|
||||
volatile uint32_t systick_uptime_millis = 0;
|
||||
|
@ -144,7 +144,7 @@ void HAL_clear_reset_source();
|
||||
// Reset reason
|
||||
uint8_t HAL_get_reset_source();
|
||||
|
||||
inline void HAL_reboot() {} // reboot the board or restart the bootloader
|
||||
void HAL_reboot();
|
||||
|
||||
void _delay_ms(const int delay);
|
||||
|
||||
|
Reference in New Issue
Block a user