mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
ports: Guard calls to machine_*_deinit_all() with #if where appropriate.
To allow these features to be properly disabled.
This commit is contained in:
@@ -187,7 +187,9 @@ soft_reset_exit:
|
||||
|
||||
// Deinit uart before timers, as esp32 uart
|
||||
// depends on a timer instance
|
||||
#if MICROPY_PY_MACHINE_UART
|
||||
machine_uart_deinit_all();
|
||||
#endif
|
||||
machine_timer_deinit_all();
|
||||
|
||||
#if MICROPY_PY_ESP32_PCNT
|
||||
@@ -210,7 +212,9 @@ soft_reset_exit:
|
||||
mp_hal_stdout_tx_str("MPY: soft reboot\r\n");
|
||||
|
||||
// deinitialise peripherals
|
||||
#if MICROPY_PY_MACHINE_PWM
|
||||
machine_pwm_deinit_all();
|
||||
#endif
|
||||
// TODO: machine_rmt_deinit_all();
|
||||
machine_pins_deinit();
|
||||
#if MICROPY_PY_MACHINE_I2C_TARGET
|
||||
|
||||
@@ -170,8 +170,12 @@ int main(void) {
|
||||
#if MICROPY_PY_NETWORK
|
||||
mod_network_deinit();
|
||||
#endif
|
||||
#if MICROPY_PY_MACHINE_UART
|
||||
machine_uart_deinit_all();
|
||||
#endif
|
||||
#if MICROPY_PY_MACHINE_PWM
|
||||
machine_pwm_deinit_all();
|
||||
#endif
|
||||
soft_timer_deinit();
|
||||
gc_sweep_all();
|
||||
mp_deinit();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user