Add reset support, minor fixes

This commit is contained in:
Hierophect 2019-08-14 13:14:42 -04:00
parent c4c55fffb1
commit 1539dca7f0
3 changed files with 10 additions and 6 deletions

View File

@ -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

View File

@ -20,4 +20,5 @@ CIRCUITPY_MINIMAL_BUILD = 1
CIRCUITPY_DIGITALIO = 1
CIRCUITPY_MICROCONTROLLER = 1
CIRCUITPY_BUSIO = 1
CIRCUITPY_TIME = 1
#endif

View File

@ -69,6 +69,6 @@ uint32_t port_get_saved_word(void) {
return _ebss;
}
// void HardFault_Handler(void) {
void HardFault_Handler(void) {
// }
}