summaryrefslogtreecommitdiff
path: root/ports/litex
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/litex
parente4c66990e27779f43f4901d431b6c61f8da85f51 (diff)
wip: ResetReason to microcontroller.cpu
Diffstat (limited to 'ports/litex')
-rw-r--r--ports/litex/common-hal/microcontroller/Processor.c8
-rw-r--r--ports/litex/common-hal/microcontroller/__init__.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/ports/litex/common-hal/microcontroller/Processor.c b/ports/litex/common-hal/microcontroller/Processor.c
index 9d2b05aad..013a7ca03 100644
--- a/ports/litex/common-hal/microcontroller/Processor.c
+++ b/ports/litex/common-hal/microcontroller/Processor.c
@@ -26,8 +26,10 @@
*/
#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 "csr.h"
@@ -62,3 +64,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
raw_id[13] = csr_readl(CSR_VERSION_SEED_ADDR + 8);
raw_id[14] = csr_readl(CSR_VERSION_SEED_ADDR + 12);
}
+
+mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {
+ return RESET_REASON_POWER_ON;
+}
diff --git a/ports/litex/common-hal/microcontroller/__init__.c b/ports/litex/common-hal/microcontroller/__init__.c
index e6f50ed5a..3c9166114 100644
--- a/ports/litex/common-hal/microcontroller/__init__.c
+++ b/ports/litex/common-hal/microcontroller/__init__.c
@@ -89,10 +89,6 @@ void common_hal_mcu_reset(void) {
while(1);
}
-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 = {