Skip to content

Commit 09c18f1

Browse files
committed
ports/zephyr: Add machine lightsleep.
1 parent acd3d74 commit 09c18f1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ports/zephyr/boards/beagleconnect_freedom.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ CONFIG_SPI=y
55
# Flash drivers
66
CONFIG_FLASH=y
77
CONFIG_FLASH_MAP=y
8+
9+
# Disable PM
10+
CONFIG_PM=n
11+
CONFIG_PM_DEVICE=n

ports/zephyr/modmachine.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static void mp_machine_idle(void) {
6464
k_yield();
6565
}
6666

67+
#if defined(CONFIG_PM_DEVICE) && defined(CONFIG_PM)
6768
static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
6869
mp_int_t milliseconds = mp_obj_get_int(args[0]);
6970
// Get the UART device
@@ -74,6 +75,11 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
7475
// Set UART device back to active state
7576
pm_device_action_run(uart0, PM_DEVICE_ACTION_RESUME);
7677
}
78+
#else
79+
static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
80+
mp_raise_ValueError(MP_ERROR_TEXT("not implemented"));
81+
}
82+
#endif
7783

7884
static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args) {
7985
mp_raise_ValueError(MP_ERROR_TEXT("not implemented"));

0 commit comments

Comments
 (0)