Add reset support, minor fixes
This commit is contained in:
parent
c4c55fffb1
commit
1539dca7f0
@ -37,11 +37,13 @@
|
||||
#include "shared-bindings/microcontroller/Processor.h"
|
||||
|
||||
#include "supervisor/filesystem.h"
|
||||
#include "supervisor/shared/safe_mode.h"
|
||||
|
||||
// This routine should work even when interrupts are disabled. Used by OneWire
|
||||
// for precise timing.
|
||||
void common_hal_mcu_delay_us(uint32_t delay) {
|
||||
//NRFX_DELAY_US(delay);
|
||||
//TODO: implement equivalent of mp_hal_delay_us(delay);
|
||||
//this is fairly annoying in the STM32 HAL
|
||||
}
|
||||
|
||||
void common_hal_mcu_disable_interrupts() {
|
||||
@ -51,12 +53,13 @@ void common_hal_mcu_enable_interrupts() {
|
||||
}
|
||||
|
||||
void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
|
||||
// TODO: see atmel-samd for functionality
|
||||
if(runmode == RUNMODE_SAFE_MODE)
|
||||
safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE);
|
||||
}
|
||||
|
||||
void common_hal_mcu_reset(void) {
|
||||
// filesystem_flush();
|
||||
// NVIC_SystemReset();
|
||||
filesystem_flush();
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
// The singleton microcontroller.Processor object, bound to microcontroller.cpu
|
||||
|
@ -20,4 +20,5 @@ CIRCUITPY_MINIMAL_BUILD = 1
|
||||
CIRCUITPY_DIGITALIO = 1
|
||||
CIRCUITPY_MICROCONTROLLER = 1
|
||||
CIRCUITPY_BUSIO = 1
|
||||
CIRCUITPY_TIME = 1
|
||||
#endif
|
@ -69,6 +69,6 @@ uint32_t port_get_saved_word(void) {
|
||||
return _ebss;
|
||||
}
|
||||
|
||||
// void HardFault_Handler(void) {
|
||||
void HardFault_Handler(void) {
|
||||
|
||||
// }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user