summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/atmel-samd/common-hal/microcontroller/__init__.c4
-rw-r--r--ports/cxd56/common-hal/microcontroller/__init__.c4
-rw-r--r--ports/esp32s2/common-hal/alarm/__init__.c43
-rw-r--r--ports/esp32s2/common-hal/alarm/pin/PinAlarm.c19
-rw-r--r--ports/esp32s2/common-hal/alarm/pin/PinAlarm.h7
-rw-r--r--ports/esp32s2/common-hal/microcontroller/Processor.c55
-rw-r--r--ports/esp32s2/common-hal/microcontroller/Processor.h6
-rw-r--r--ports/esp32s2/common-hal/microcontroller/__init__.c8
-rw-r--r--ports/esp32s2/common-hal/rtc/RTC.h6
-rw-r--r--ports/esp32s2/common-hal/supervisor/Runtime.h6
-rw-r--r--ports/esp32s2/supervisor/internal_flash_root_pointers.h6
-rw-r--r--ports/litex/common-hal/microcontroller/__init__.c4
-rw-r--r--ports/mimxrt10xx/common-hal/microcontroller/__init__.c4
-rw-r--r--ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h6
-rw-r--r--ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h6
-rw-r--r--ports/nrf/common-hal/microcontroller/__init__.c4
-rw-r--r--ports/nrf/common-hal/rgbmatrix/RGBMatrix.h4
-rw-r--r--ports/stm/common-hal/microcontroller/__init__.c4
-rw-r--r--ports/stm/common-hal/rgbmatrix/RGBMatrix.h4
19 files changed, 153 insertions, 47 deletions
diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c
index 50a1ec038..ca39f2838 100644
--- a/ports/atmel-samd/common-hal/microcontroller/__init__.c
+++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c
@@ -84,6 +84,10 @@ void common_hal_mcu_reset(void) {
reset();
}
+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 = {
diff --git a/ports/cxd56/common-hal/microcontroller/__init__.c b/ports/cxd56/common-hal/microcontroller/__init__.c
index 7aa3b839d..57140dec7 100644
--- a/ports/cxd56/common-hal/microcontroller/__init__.c
+++ b/ports/cxd56/common-hal/microcontroller/__init__.c
@@ -81,6 +81,10 @@ void common_hal_mcu_reset(void) {
boardctl(BOARDIOC_RESET, 0);
}
+void common_hal_mcu_deep_sleep(void) {
+ //deep sleep call here
+}
+
STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_UART2_RXD), MP_ROM_PTR(&pin_UART2_RXD) },
{ MP_ROM_QSTR(MP_QSTR_UART2_TXD), MP_ROM_PTR(&pin_UART2_TXD) },
diff --git a/ports/esp32s2/common-hal/alarm/__init__.c b/ports/esp32s2/common-hal/alarm/__init__.c
index e33534550..4a255c51c 100644
--- a/ports/esp32s2/common-hal/alarm/__init__.c
+++ b/ports/esp32s2/common-hal/alarm/__init__.c
@@ -25,12 +25,20 @@
* THE SOFTWARE.
*/
+#include "py/objtuple.h"
+
#include "shared-bindings/alarm/__init__.h"
#include "shared-bindings/alarm/pin/PinAlarm.h"
#include "shared-bindings/alarm/time/DurationAlarm.h"
#include "esp_sleep.h"
+STATIC mp_obj_tuple_t *_deep_sleep_alarms;
+
+void alarm_reset(void) {
+ _deep_sleep_alarms = &mp_const_empty_tuple;
+}
+
void common_hal_alarm_disable_all(void) {
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
}
@@ -63,3 +71,38 @@ mp_obj_t common_hal_alarm_get_wake_alarm(void) {
}
return mp_const_none;
}
+
+mp_obj_t common_hal_alarm_sleep_until_alarms(size_t n_alarms, const mp_obj_t *alarms) {
+ mp_raise_NotImplementedError(NULL);
+}
+
+void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms) {
+ bool time_alarm_set = false;
+ for (size_t i = 0; i < n_alarms; i++) {
+ if (MP_OBJ_IS_TYPE(alarms[i], &alarm_pin_pin_alarm_type)) {
+ mp_raise_NotImplementedError(translate("PinAlarm deep sleep not yet implemented"));
+ }
+ if (MP_OBJ_IS_TYPE(alarms[i], &alarm_time_duration_alarm_type)) {
+ if (time_alarm_set) {
+ mp_raise_ValueError(translate("Only one alarm.time alarm can be set."));
+ }
+ time_alarm_set = true;
+ }
+ }
+
+ _deep_sleep_alarms = mp_obj_new_tuple(n_alarms, alarms);
+}
+
+void common_hal_deep_sleep_with_alarms(void) {
+ for (size_t i = 0; i < _deep_sleep_alarms.len; i++) {
+ mp_obj_t alarm = _deep_sleep_alarms.items[i]
+ if (MP_OBJ_IS_TYPE(alarm, &alarm_time_duration_alarm_type)) {
+ alarm_time_duration_alarm_obj_t *duration_alarm = MP_OBJ_TO_PTR(alarm);
+ esp_sleep_enable_timer_wakeup(
+ (uint64_t) (duration_alarm->duration * 1000000.0f));
+ }
+ // TODO: handle pin alarms
+ }
+
+ common_hal_mcu_deep_sleep();
+}
diff --git a/ports/esp32s2/common-hal/alarm/pin/PinAlarm.c b/ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
index 6ac3d05f8..f26c8a179 100644
--- a/ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
+++ b/ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
@@ -30,19 +30,24 @@
#include "shared-bindings/alarm/pin/PinAlarm.h"
#include "shared-bindings/microcontroller/Pin.h"
-void common_hal_alarm_pin_pin_alarm_construct(alarm_pin_pin_alarm_obj_t *self, const mcu_pin_obj_t *pin, bool level, bool edge, bool pull) {
- self->pin = pin;
- self->level = level;
+void common_hal_alarm_pin_pin_alarm_construct(alarm_pin_pin_alarm_obj_t *self, const mp_obj_t pins[], size_t num_pins, bool value, bool all_same_value, bool edge, bool pull) {
+ self->pins = mp_obj_new_tuple(num_pins, pins);
+ self->value = value;
+ self->all_same_value = all_same_value;
self->edge = edge;
self->pull = pull;
}
-const mcu_pin_obj_t *common_hal_alarm_pin_pin_alarm_get_pin(alarm_pin_pin_alarm_obj_t *self) {
- return self->pin;
+const mp_obj_tuple_t *common_hal_alarm_pin_pin_alarm_get_pins(alarm_pin_pin_alarm_obj_t *self) {
+ return self->pins;
}
-bool common_hal_alarm_pin_pin_alarm_get_level(alarm_pin_pin_alarm_obj_t *self) {
- return self->level;
+bool common_hal_alarm_pin_pin_alarm_get_value(alarm_pin_pin_alarm_obj_t *self) {
+ return self->value;
+}
+
+bool common_hal_alarm_pin_pin_alarm_get_all_same_value(alarm_pin_pin_alarm_obj_t *self) {
+ return self->all_same_value;
}
bool common_hal_alarm_pin_pin_alarm_get_edge(alarm_pin_pin_alarm_obj_t *self) {
diff --git a/ports/esp32s2/common-hal/alarm/pin/PinAlarm.h b/ports/esp32s2/common-hal/alarm/pin/PinAlarm.h
index c6a760b96..d7e7e2552 100644
--- a/ports/esp32s2/common-hal/alarm/pin/PinAlarm.h
+++ b/ports/esp32s2/common-hal/alarm/pin/PinAlarm.h
@@ -24,13 +24,14 @@
* THE SOFTWARE.
*/
-
#include "py/obj.h"
+#include "py/objtuple.h"
typedef struct {
mp_obj_base_t base;
- const mcu_pin_obj_t *pin;
- bool level;
+ mp_obj_tuple_t *pins;
+ bool value;
+ bool all_same_value;
bool edge;
bool pull;
} alarm_pin_pin_alarm_obj_t;
diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/esp32s2/common-hal/microcontroller/Processor.c
index bd625dc6e..fffd1a1b1 100644
--- a/ports/esp32s2/common-hal/microcontroller/Processor.c
+++ b/ports/esp32s2/common-hal/microcontroller/Processor.c
@@ -31,8 +31,12 @@
#include "py/runtime.h"
#include "common-hal/microcontroller/Processor.h"
+#include "shared-bindings/microcontroller/ResetReason.h"
#include "supervisor/shared/translate.h"
+#include "esp_sleep.h"
+#include "esp_system.h"
+
#include "soc/efuse_reg.h"
#include "components/driver/esp32s2/include/driver/temp_sensor.h"
@@ -77,21 +81,42 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
}
mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {
- switch (esp_sleep_get_wakeup_cause()) {
- case ESP_SLEEP_WAKEUP_TIMER:
- return RESET_REASON_DEEP_SLEEP_ALARM;
-
- case ESP_SLEEP_WAKEUP_EXT0:
- return RESET_REASON_DEEP_SLEEP_ALARM;
-
- case ESP_SLEEP_WAKEUP_TOUCHPAD:
- //TODO: implement TouchIO
- case ESP_SLEEP_WAKEUP_UNDEFINED:
+ switch (esp_reset_reason()) {
+ case ESP_RST_POWERON:
+ return RESET_REASON_POWER_ON;
+
+ case ESP_RST_SW:
+ case ESP_RST_PANIC:
+ return RESET_REASON_SOFTWARE;
+
+ case ESP_RST_INT_WDT:
+ case ESP_RST_TASK_WDT:
+ case ESP_RST_WDT:
+ return RESET_REASON_WATCHDOG;
+
+ case ESP_RST_BROWNOUT:
+ return RESET_REASON_BROWNOUT;
+
+ case ESP_RST_SDIO:
+ case ESP_RST_EXT:
+ return RESET_REASON_RESET_PIN;
+
+ case ESP_RST_DEEPSLEEP:
+ switch (esp_sleep_get_wakeup_cause()) {
+ case ESP_SLEEP_WAKEUP_TIMER:
+ case ESP_SLEEP_WAKEUP_EXT0:
+ case ESP_SLEEP_WAKEUP_EXT1:
+ case ESP_SLEEP_WAKEUP_TOUCHPAD:
+ return RESET_REASON_DEEP_SLEEP_ALARM;
+
+ case ESP_SLEEP_WAKEUP_UNDEFINED:
+ default:
+ return RESET_REASON_UNKNOWN;
+ }
+
+ case ESP_RST_UNKNOWN:
default:
- return RESET_REASON_POWER_APPLIED;
- }
-}
+ return RESET_REASON_UNKNOWN;
-mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {
- return RESET_REASON_POWER_ON;
+ }
}
diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.h b/ports/esp32s2/common-hal/microcontroller/Processor.h
index f6636b333..641a11d55 100644
--- a/ports/esp32s2/common-hal/microcontroller/Processor.h
+++ b/ports/esp32s2/common-hal/microcontroller/Processor.h
@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
-#define MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
+#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
+#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 6
@@ -36,4 +36,4 @@ typedef struct {
// Stores no state currently.
} mcu_processor_obj_t;
-#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
+#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
diff --git a/ports/esp32s2/common-hal/microcontroller/__init__.c b/ports/esp32s2/common-hal/microcontroller/__init__.c
index 3056c6565..fdfbd65fa 100644
--- a/ports/esp32s2/common-hal/microcontroller/__init__.c
+++ b/ports/esp32s2/common-hal/microcontroller/__init__.c
@@ -79,6 +79,14 @@ void common_hal_mcu_reset(void) {
while(1);
}
+void common_hal_mcu_deep_sleep(void) {
+ // Shut down wifi cleanly.
+ esp_wifi_stop();
+
+ // Does not return.
+ esp_deep_sleep_start();
+}
+
// 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 = {
diff --git a/ports/esp32s2/common-hal/rtc/RTC.h b/ports/esp32s2/common-hal/rtc/RTC.h
index e51f1f784..233cde3fd 100644
--- a/ports/esp32s2/common-hal/rtc/RTC.h
+++ b/ports/esp32s2/common-hal/rtc/RTC.h
@@ -24,11 +24,11 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
-#define MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
+#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_RTC_RTC_H
+#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_RTC_RTC_H
extern void rtc_init(void);
extern void rtc_reset(void);
extern void common_hal_rtc_init(void);
-#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H
+#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_RTC_RTC_H
diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.h b/ports/esp32s2/common-hal/supervisor/Runtime.h
index d1fe24621..840ce1bbb 100644
--- a/ports/esp32s2/common-hal/supervisor/Runtime.h
+++ b/ports/esp32s2/common-hal/supervisor/Runtime.h
@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H
-#define MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H
+#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SUPERVISOR_RUNTIME_H
+#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SUPERVISOR_RUNTIME_H
#include "py/obj.h"
@@ -34,4 +34,4 @@ typedef struct {
// Stores no state currently.
} super_runtime_obj_t;
-#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H
+#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SUPERVISOR_RUNTIME_H
diff --git a/ports/esp32s2/supervisor/internal_flash_root_pointers.h b/ports/esp32s2/supervisor/internal_flash_root_pointers.h
index ae3e45e14..a9a8c2a22 100644
--- a/ports/esp32s2/supervisor/internal_flash_root_pointers.h
+++ b/ports/esp32s2/supervisor/internal_flash_root_pointers.h
@@ -23,9 +23,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H
-#define MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H
+#ifndef MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_ROOT_POINTERS_H
+#define MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_ROOT_POINTERS_H
#define FLASH_ROOT_POINTERS
-#endif // MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H
+#endif // MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_ROOT_POINTERS_H
diff --git a/ports/litex/common-hal/microcontroller/__init__.c b/ports/litex/common-hal/microcontroller/__init__.c
index 3c9166114..e6f50ed5a 100644
--- a/ports/litex/common-hal/microcontroller/__init__.c
+++ b/ports/litex/common-hal/microcontroller/__init__.c
@@ -89,6 +89,10 @@ 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 = {
diff --git a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c
index 6a8537e2d..0329ced69 100644
--- a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c
+++ b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c
@@ -86,6 +86,10 @@ 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 = {
diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h
index c3f04a049..c50d73294 100644
--- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h
+++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h
@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
-#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
+#ifndef MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H
+#define MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H
extern LPI2C_Type *mcu_i2c_banks[2];
@@ -47,4 +47,4 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[4];
extern const mcu_pwm_obj_t mcu_pwm_list[20];
-#endif // MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIP_H
+#endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H
diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h
index 4f6ab6261..067c05d0d 100644
--- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h
+++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h
@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
-#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
+#ifndef MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H
+#define MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H
extern LPI2C_Type *mcu_i2c_banks[4];
@@ -47,4 +47,4 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[9];
extern const mcu_pwm_obj_t mcu_pwm_list[67];
-#endif // MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
+#endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H
diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c
index 06aac9409..9911896bf 100644
--- a/ports/nrf/common-hal/microcontroller/__init__.c
+++ b/ports/nrf/common-hal/microcontroller/__init__.c
@@ -95,6 +95,10 @@ void common_hal_mcu_reset(void) {
reset_cpu();
}
+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 = {
diff --git a/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h
index 48de4dcb2..24d86f177 100644
--- a/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h
+++ b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h
@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
-#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
+#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
+#define MICROPY_INCLUDED_NRF_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
void *common_hal_rgbmatrix_timer_allocate(void);
void common_hal_rgbmatrix_timer_enable(void*);
diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c
index a827399cc..bc81b0e4f 100644
--- a/ports/stm/common-hal/microcontroller/__init__.c
+++ b/ports/stm/common-hal/microcontroller/__init__.c
@@ -81,6 +81,10 @@ 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 = {
diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.h b/ports/stm/common-hal/rgbmatrix/RGBMatrix.h
index 48de4dcb2..323878d20 100644
--- a/ports/stm/common-hal/rgbmatrix/RGBMatrix.h
+++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.h
@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
-#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
+#ifndef MICROPY_INCLUDED_STM_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
+#define MICROPY_INCLUDED_STM_COMMON_HAL_RGBMATRIX_RGBMATRIX_H
void *common_hal_rgbmatrix_timer_allocate(void);
void common_hal_rgbmatrix_timer_enable(void*);