ports: Guard calls to machine_*_deinit_all() with #if where appropriate.

To allow these features to be properly disabled.
This commit is contained in:
garywill
2025-11-15 11:40:39 +08:00
committed by Damien George
parent 4e79698a99
commit 3d2eb3b8e9
3 changed files with 14 additions and 0 deletions

View File

@@ -249,15 +249,21 @@ int main(int argc, char **argv) {
#if MICROPY_PY_NETWORK
mod_network_deinit();
#endif
#if MICROPY_PY_MACHINE_I2S
machine_i2s_deinit_all();
#endif
rp2_dma_deinit();
rp2_pio_deinit();
#if MICROPY_PY_BLUETOOTH
mp_bluetooth_deinit();
#endif
#if MICROPY_PY_MACHINE_PWM
machine_pwm_deinit_all();
#endif
machine_pin_deinit();
#if MICROPY_PY_MACHINE_UART
machine_uart_deinit_all();
#endif
#if MICROPY_PY_MACHINE_I2C_TARGET
mp_machine_i2c_target_deinit_all();
#endif