summaryrefslogtreecommitdiff
path: root/ports/stm
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-11-21 23:29:52 -0500
committerDan Halbert <halbert@halwitz.org>2020-11-21 23:29:52 -0500
commit75559f35ccc946dfd292e25671919e5d5b3bd7a6 (patch)
tree0b35247469879119e23c6d56f61866b386d121a0 /ports/stm
parente4c66990e27779f43f4901d431b6c61f8da85f51 (diff)
wip: ResetReason to microcontroller.cpu
Diffstat (limited to 'ports/stm')
-rw-r--r--ports/stm/common-hal/microcontroller/Processor.c9
-rw-r--r--ports/stm/common-hal/microcontroller/__init__.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/ports/stm/common-hal/microcontroller/Processor.c b/ports/stm/common-hal/microcontroller/Processor.c
index 8dc968b36..d77d287a9 100644
--- a/ports/stm/common-hal/microcontroller/Processor.c
+++ b/ports/stm/common-hal/microcontroller/Processor.c
@@ -25,9 +25,12 @@
*/
#include <math.h>
-#include "common-hal/microcontroller/Processor.h"
#include "py/runtime.h"
+
+#include "common-hal/microcontroller/Processor.h"
+#include "shared-bindings/microcontroller/ResetReason.h"
#include "supervisor/shared/translate.h"
+
#include STM32_HAL_H
#if CPY_STM32F4
@@ -138,3 +141,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
}
#endif
}
+
+mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {
+ return RESET_REASON_POWER_ON;
+}
diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c
index bc81b0e4f..a827399cc 100644
--- a/ports/stm/common-hal/microcontroller/__init__.c
+++ b/ports/stm/common-hal/microcontroller/__init__.c
@@ -81,10 +81,6 @@ void common_hal_mcu_reset(void) {
NVIC_SystemReset();
}
-void common_hal_mcu_deep_sleep(void) {
- //deep sleep call here
-}
-
// The singleton microcontroller.Processor object, bound to microcontroller.cpu
// It currently only has properties, and no state.
const mcu_processor_obj_t common_hal_mcu_processor_obj = {