Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
b637d39
Initial commit
gamblor21 Oct 25, 2020
12d770b
Added __probe_for_device
gamblor21 Oct 25, 2020
8a37983
Added doc and translations
gamblor21 Oct 26, 2020
9ec2245
Clean up
gamblor21 Oct 27, 2020
2374b0d
Fixed whitespace issues
gamblor21 Oct 27, 2020
90b9ec6
Initial Sleep Support
microdev1 Sep 18, 2020
3a30887
Update soft reboot message
microdev1 Sep 18, 2020
e310b87
Get io wake working
microdev1 Sep 19, 2020
05a3f20
Add function to get time elapsed during sleep
microdev1 Sep 22, 2020
21ba61a
Add function to disable alarm
microdev1 Sep 22, 2020
e5ff55b
Renamed alarm modules
microdev1 Sep 23, 2020
4d8ffdc
restructure alarm modules
microdev1 Sep 24, 2020
da44972
Fix build error
microdev1 Sep 24, 2020
59df1a1
Add alarm_touch module
microdev1 Sep 24, 2020
e359389
Add description of alarm modules
microdev1 Sep 24, 2020
930cf14
Add check for invalid io, function to disable all alarms
microdev1 Sep 26, 2020
0e444f0
Implement sleep on code.py exit
microdev1 Sep 30, 2020
354536c
Update translation
microdev1 Oct 7, 2020
1196d4b
move to new module
tannewt Oct 14, 2020
85dadf3
More API changes
tannewt Oct 15, 2020
9a4efed
Start tweaking the workflow to sleep
tannewt Oct 28, 2020
e7da852
Fixing review comments
gamblor21 Oct 29, 2020
78477a3
Initial SPI commit
gamblor21 Oct 31, 2020
5ea09fe
Fixed stubs
gamblor21 Oct 31, 2020
76c1153
Fixed stubs
gamblor21 Nov 1, 2020
7dd5380
Fixed stubs again
gamblor21 Nov 1, 2020
8bbbb28
Fixes from testing SPI
gamblor21 Nov 2, 2020
197539b
Moved I2CDevice and SPI to match python library
gamblor21 Nov 3, 2020
4c93db3
Renamed to adafruit_bus_device
gamblor21 Nov 4, 2020
03b110b
Add abort check in I2C lock
gamblor21 Nov 11, 2020
f61c4e6
Removing from smaller builds
gamblor21 Nov 11, 2020
23ed3ef
Removing frozen libs
gamblor21 Nov 11, 2020
bb77f1d
wip: initial code changes, starting from @tannewt's sleepio branch
dhalbert Nov 16, 2020
ffff02c
Merge remote-tracking branch 'adafruit/main' into sleep
dhalbert Nov 16, 2020
682054a
WIP: redo API; not compiled yet
dhalbert Nov 19, 2020
5bb3c32
merge from main
dhalbert Nov 19, 2020
649c930
wip
dhalbert Nov 19, 2020
cd436ba
Merge remote-tracking branch 'adafruit/main' into sleep
dhalbert Nov 19, 2020
39e1f52
wip; not compiling yet
dhalbert Nov 19, 2020
e4c6699
compiles
dhalbert Nov 21, 2020
75559f3
wip: ResetReason to microcontroller.cpu
dhalbert Nov 22, 2020
a0f1ec3
wip
dhalbert Nov 23, 2020
25591a3
Merge branch 'esp32s2-common-hal-mcu-delay-us' into sleep
dhalbert Nov 23, 2020
3abee9b
compiles; maybe ready to test, or almost
dhalbert Nov 23, 2020
7a45afc
working, but need to avoid deep sleeping too fast before USB ready
dhalbert Nov 24, 2020
f868cc5
some API renaming and bug fixes; fix docs
dhalbert Nov 25, 2020
9dbea36
changed alarm.time API
dhalbert Nov 25, 2020
ef0830b
merge from upstream + wip
dhalbert Nov 25, 2020
104a089
deep sleep working; deep sleep delay when connected
dhalbert Nov 27, 2020
e308a9e
working! PinAlarm not implemented yet.
dhalbert Nov 27, 2020
596e0e4
merge from upstream
dhalbert Nov 27, 2020
f96475c
update Requests; rolled back by accident
dhalbert Nov 27, 2020
65e2fe4
fix stub problems; touch up doc
dhalbert Nov 28, 2020
2830cc9
make translate
dhalbert Nov 28, 2020
28d9e91
Disable complex arithmetic on SAMD21 builds to make space
dhalbert Nov 28, 2020
4ac4faa
Use nina-fw root certs
tannewt Dec 1, 2020
9276244
Two minor socket changes
tannewt Dec 1, 2020
9a9e972
Ignore certificates readme in doc build
tannewt Dec 1, 2020
a95285a
Translated using Weblate (Polish)
szajakubiak Dec 1, 2020
f6cba4c
Translated using Weblate (Polish)
tawez Dec 1, 2020
44e0d98
Translated using Weblate (Polish)
szajakubiak Dec 1, 2020
2b9ca4d
Translated using Weblate (Polish)
tawez Dec 1, 2020
2373857
Merge branch 'main' into bus_device
gamblor21 Dec 1, 2020
d3bbb99
Fixing stubs
gamblor21 Dec 1, 2020
8b7c23c
address review comments
dhalbert Dec 2, 2020
fe1c2fa
Removed bus device from simmel build
gamblor21 Dec 2, 2020
72fa7d8
fix doc errors
dhalbert Dec 2, 2020
73e22f9
Block all tasks (not interrupts) during flash erase
tannewt Dec 2, 2020
cb863e4
Added to partial builds where frozen removed
gamblor21 Dec 2, 2020
1c00deb
Translated using Weblate (Polish)
tawez Dec 1, 2020
9e6b2b1
Translated using Weblate (Czech)
vkuthan Dec 1, 2020
d7ba641
Merge pull request #3767 from dhalbert/sleep
tannewt Dec 2, 2020
8f6baa2
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
7655102
Update translation files
weblate Dec 2, 2020
31acfed
Merge pull request #3780 from tannewt/block_while_erasing
dhalbert Dec 2, 2020
51fd678
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
9b3186b
Merge pull request #3776 from tannewt/backup_socket_timeout
dhalbert Dec 2, 2020
c7749a5
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
348392f
Merge pull request #3775 from tannewt/nina_certs
dhalbert Dec 2, 2020
a483cd1
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
1130b80
Merge pull request #3612 from gamblor21/bus_device
tannewt Dec 2, 2020
079bf7a
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
03d0ec8
Update translation files
weblate Dec 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
dhalbert committed Nov 23, 2020
commit a0f1ec3c4a3dd52b11752e10d0dd31202e9c705f
16 changes: 12 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
#include "supervisor/usb.h"

#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/supervisor/Runtime.h"

#include "boards/board.h"

Expand Down Expand Up @@ -327,24 +329,27 @@ bool run_code_py(safe_mode_t safe_mode) {
#endif
rgb_status_animation_t animation;
bool ok = result.return_code != PYEXEC_EXCEPTION;
#if CIRCUITPY_ALARM
// If USB isn't enumerated then deep sleep.
if (ok && !supervisor_workflow_active() && supervisor_ticks_ms64() > CIRCUITPY_USB_ENUMERATION_DELAY * 1024) {
common_hal_alarm_restart_on_alarm(0, NULL);
common_hal_mcu_deep_sleep();
}
#endif
// Show the animation every N seconds.
prep_rgb_status_animation(&result, found_main, safe_mode, &animation);
while (true) {
RUN_BACKGROUND_TASKS;
if (reload_requested) {
supervisor_set_run_reason(RUN_REASON_AUTO_RELOAD);
reload_requested = false;
return true;
}

if (serial_connected() && serial_bytes_available()) {
// Skip REPL if reload was requested.
return (serial_read() == CHAR_CTRL_D);
bool ctrl_d = serial_read() == CHAR_CTRL_D;
if (ctrl_d) {
supervisor_set_run_reason(RUN_REASON_REPL_RELOAD);
}
return (ctrl_d);
}

if (!serial_connected_before_animation && serial_connected()) {
Expand Down Expand Up @@ -521,6 +526,9 @@ int __attribute__((used)) main(void) {
reset_devices();
reset_board();

// This is first time we are running CircuitPython after a reset or power-up.
supervisor_set_run_reason(RUN_REASON_STARTUP);

// If not in safe mode turn on autoreload by default but before boot.py in case it wants to change it.
if (safe_mode == NO_SAFE_MODE) {
autoreload_enable();
Expand Down
4 changes: 4 additions & 0 deletions ports/atmel-samd/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 4 additions & 0 deletions ports/cxd56/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
43 changes: 43 additions & 0 deletions ports/esp32s2/common-hal/alarm/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
}
19 changes: 12 additions & 7 deletions ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 4 additions & 3 deletions ports/esp32s2/common-hal/alarm/pin/PinAlarm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
55 changes: 40 additions & 15 deletions ports/esp32s2/common-hal/microcontroller/Processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
}
6 changes: 3 additions & 3 deletions ports/esp32s2/common-hal/microcontroller/Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
8 changes: 8 additions & 0 deletions ports/esp32s2/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 3 additions & 3 deletions ports/esp32s2/common-hal/rtc/RTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions ports/esp32s2/common-hal/supervisor/Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
6 changes: 3 additions & 3 deletions ports/esp32s2/supervisor/internal_flash_root_pointers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions ports/litex/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 4 additions & 0 deletions ports/mimxrt10xx/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 3 additions & 3 deletions ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -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
6 changes: 3 additions & 3 deletions ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -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
4 changes: 4 additions & 0 deletions ports/nrf/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading