summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/esp32/boards/ESP32_GENERIC_C6/mpconfigboard.h2
-rw-r--r--ports/esp32/boards/M5STACK_NANOC6/mpconfigboard.h2
-rw-r--r--ports/esp32/boards/UM_TINYC6/mpconfigboard.h2
-rw-r--r--ports/esp32/mpconfigport.h3
-rw-r--r--ports/stm32/boards/ARDUINO_OPTA/board_init.c7
-rw-r--r--ports/stm32/i2c.c4
-rw-r--r--ports/stm32/i2cslave.c2
-rw-r--r--ports/stm32/i2cslave.h4
-rw-r--r--ports/stm32/mpconfigboard_common.h2
-rw-r--r--ports/unix/input.c3
-rw-r--r--ports/unix/main.c3
11 files changed, 18 insertions, 16 deletions
diff --git a/ports/esp32/boards/ESP32_GENERIC_C6/mpconfigboard.h b/ports/esp32/boards/ESP32_GENERIC_C6/mpconfigboard.h
index d6cc9a6f6..712e1fca1 100644
--- a/ports/esp32/boards/ESP32_GENERIC_C6/mpconfigboard.h
+++ b/ports/esp32/boards/ESP32_GENERIC_C6/mpconfigboard.h
@@ -3,7 +3,5 @@
#define MICROPY_HW_BOARD_NAME "ESP32C6 module"
#define MICROPY_HW_MCU_NAME "ESP32C6"
-#define MICROPY_PY_MACHINE_I2S (0)
-
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
#define MICROPY_HW_ENABLE_UART_REPL (1)
diff --git a/ports/esp32/boards/M5STACK_NANOC6/mpconfigboard.h b/ports/esp32/boards/M5STACK_NANOC6/mpconfigboard.h
index 656ec0bc6..16ddc1e51 100644
--- a/ports/esp32/boards/M5STACK_NANOC6/mpconfigboard.h
+++ b/ports/esp32/boards/M5STACK_NANOC6/mpconfigboard.h
@@ -1,7 +1,5 @@
#define MICROPY_HW_BOARD_NAME "M5Stack NanoC6"
#define MICROPY_HW_MCU_NAME "ESP32C6"
-#define MICROPY_PY_MACHINE_I2S (0)
-
#define MICROPY_HW_I2C0_SCL (1)
#define MICROPY_HW_I2C0_SDA (2)
diff --git a/ports/esp32/boards/UM_TINYC6/mpconfigboard.h b/ports/esp32/boards/UM_TINYC6/mpconfigboard.h
index 09392d555..131116e9f 100644
--- a/ports/esp32/boards/UM_TINYC6/mpconfigboard.h
+++ b/ports/esp32/boards/UM_TINYC6/mpconfigboard.h
@@ -1,8 +1,6 @@
#define MICROPY_HW_BOARD_NAME "Unexpected Maker TinyC6"
#define MICROPY_HW_MCU_NAME "ESP32C6"
-#define MICROPY_PY_MACHINE_I2S (0)
-
#define MICROPY_HW_I2C0_SCL (7)
#define MICROPY_HW_I2C0_SDA (6)
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index 9b12dbd34..0e62cd748 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -137,8 +137,7 @@
#define MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1 (1)
#ifndef MICROPY_PY_MACHINE_I2C_TARGET
// I2C target hardware is limited on ESP32 (eg read event comes after the read) so we only support newer SoCs.
-// ESP32C6 does not have enough flash space so also disable it on that SoC.
-#define MICROPY_PY_MACHINE_I2C_TARGET (SOC_I2C_SUPPORT_SLAVE && !CONFIG_IDF_TARGET_ESP32 && !CONFIG_IDF_TARGET_ESP32C6)
+#define MICROPY_PY_MACHINE_I2C_TARGET (SOC_I2C_SUPPORT_SLAVE && !CONFIG_IDF_TARGET_ESP32)
#define MICROPY_PY_MACHINE_I2C_TARGET_INCLUDEFILE "ports/esp32/machine_i2c_target.c"
#define MICROPY_PY_MACHINE_I2C_TARGET_MAX (2)
#endif
diff --git a/ports/stm32/boards/ARDUINO_OPTA/board_init.c b/ports/stm32/boards/ARDUINO_OPTA/board_init.c
index c0907f5d3..51b5b9442 100644
--- a/ports/stm32/boards/ARDUINO_OPTA/board_init.c
+++ b/ports/stm32/boards/ARDUINO_OPTA/board_init.c
@@ -61,6 +61,13 @@ void OPTA_board_early_init(void) {
HAL_MPU_ConfigRegion(&MPU_InitStruct);
}
#endif
+
+ // Reset ETH Phy
+ mp_hal_pin_config(pyb_pin_ETH_RST, MP_HAL_PIN_MODE_OUTPUT, MP_HAL_PIN_PULL_UP, 0);
+ mp_hal_pin_config_speed(pyb_pin_ETH_RST, MP_HAL_PIN_SPEED_LOW);
+ mp_hal_pin_write(pyb_pin_ETH_RST, 0);
+ HAL_Delay(100);
+ mp_hal_pin_write(pyb_pin_ETH_RST, 1);
}
void OPTA_board_enter_bootloader(void) {
diff --git a/ports/stm32/i2c.c b/ports/stm32/i2c.c
index 4effb2343..778885eac 100644
--- a/ports/stm32/i2c.c
+++ b/ports/stm32/i2c.c
@@ -279,10 +279,6 @@ int i2c_write(i2c_t *i2c, const uint8_t *src, size_t len, size_t next_len) {
#elif defined(STM32L4)
#define APB1ENR APB1ENR1
#define RCC_APB1ENR_I2C1EN RCC_APB1ENR1_I2C1EN
-#if defined(STM32L432xx)
-// Not a real peripheral, only needed for i2c_id calculation in i2c_init.
-#define I2C2_BASE (APB1PERIPH_BASE + 0x5800UL)
-#endif
#endif
static uint16_t i2c_timeout_ms[MICROPY_HW_MAX_I2C];
diff --git a/ports/stm32/i2cslave.c b/ports/stm32/i2cslave.c
index 0e4fbf489..782cca7e4 100644
--- a/ports/stm32/i2cslave.c
+++ b/ports/stm32/i2cslave.c
@@ -76,7 +76,7 @@ void i2c_slave_irq_handler(i2c_slave_t *i2c) {
}
}
-#elif defined(STM32F7) || defined(STM32H7) || defined(STM32WB)
+#elif defined(STM32F7) || defined(STM32H7) || defined(STM32L4) || defined(STM32WB)
void i2c_slave_init_helper(i2c_slave_t *i2c, int addr) {
i2c->CR1 = I2C_CR1_STOPIE | I2C_CR1_ADDRIE | I2C_CR1_RXIE | I2C_CR1_TXIE;
diff --git a/ports/stm32/i2cslave.h b/ports/stm32/i2cslave.h
index edead6cb2..0b3317efa 100644
--- a/ports/stm32/i2cslave.h
+++ b/ports/stm32/i2cslave.h
@@ -28,7 +28,7 @@
#include STM32_HAL_H
-#if defined(STM32F4) || defined(STM32F7) || defined(STM32H7) || defined(STM32WB)
+#if defined(STM32F4) || defined(STM32F7) || defined(STM32H7) || defined(STM32L4) || defined(STM32WB)
#if !defined(I2C2_BASE)
// This MCU doesn't have I2C2_BASE, define it so that the i2c_idx calculation works.
@@ -63,7 +63,7 @@ static inline void i2c_slave_init(i2c_slave_t *i2c, int irqn, int irq_pri, int a
volatile uint32_t tmp = RCC->APB1ENR1; // Delay after enabling clock
(void)tmp;
}
- #elif defined(STM32WB)
+ #elif defined(STM32L4) || defined(STM32WB)
RCC->APB1ENR1 |= 1 << (RCC_APB1ENR1_I2C1EN_Pos + i2c_idx);
volatile uint32_t tmp = RCC->APB1ENR1; // Delay after enabling clock
(void)tmp;
diff --git a/ports/stm32/mpconfigboard_common.h b/ports/stm32/mpconfigboard_common.h
index a8e50be5c..d5cef1fec 100644
--- a/ports/stm32/mpconfigboard_common.h
+++ b/ports/stm32/mpconfigboard_common.h
@@ -640,7 +640,7 @@
|| defined(MICROPY_HW_I2C3_SCL) || defined(MICROPY_HW_I2C4_SCL)
#define MICROPY_HW_ENABLE_HW_I2C (1)
#ifndef MICROPY_HW_ENABLE_HW_I2C_TARGET
-#if defined(STM32F4) || defined(STM32F7) || defined(STM32H7) || defined(STM32WB)
+#if defined(STM32F4) || defined(STM32F7) || defined(STM32H7) || defined(STM32L4) || defined(STM32WB)
#define MICROPY_HW_ENABLE_HW_I2C_TARGET (1)
#else
#define MICROPY_HW_ENABLE_HW_I2C_TARGET (0)
diff --git a/ports/unix/input.c b/ports/unix/input.c
index 31926a5a8..260e9eac8 100644
--- a/ports/unix/input.c
+++ b/ports/unix/input.c
@@ -104,6 +104,9 @@ void prompt_write_history(void) {
#if MICROPY_USE_READLINE == 1
char *home = getenv("HOME");
if (home != NULL) {
+ if (MP_STATE_THREAD(gc_lock_depth) != 0) {
+ return;
+ }
vstr_t vstr;
vstr_init(&vstr, 50);
vstr_printf(&vstr, "%s/.micropython.history", home);
diff --git a/ports/unix/main.c b/ports/unix/main.c
index 51d99ce5f..0acd8c9f2 100644
--- a/ports/unix/main.c
+++ b/ports/unix/main.c
@@ -209,6 +209,9 @@ static int do_repl(void) {
mp_hal_stdio_mode_raw();
input_restart:
+ // If the GC is locked at this point there is no way out except a reset,
+ // so force the GC to be unlocked to help the user debug what went wrong.
+ MP_STATE_THREAD(gc_lock_depth) = 0;
vstr_reset(&line);
int ret = readline(&line, mp_repl_get_ps1());
mp_parse_input_kind_t parse_input_kind = MP_PARSE_SINGLE_INPUT;