diff options
| author | robert-hh <robert@hammelrath.com> | 2023-03-11 08:03:18 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-05-22 18:39:07 +1000 |
| commit | 47fa723586dc4ae81df02f5a0a10b2b018045ab0 (patch) | |
| tree | 0a3049c9cd305d0e69c937c5c25b5387f30fbcae /ports/samd/main.c | |
| parent | b2df094bf8051758b10f2f0222e09e79ed97427e (diff) | |
samd/modmachine: Make some machine classes configurable by #defines.
These include ADC, DAC, I2C, SoftI2C, SPI, SoftI2C, PWM, UART, pulse. This
is useful for devices like the Adafruit Trinket series which have almost no
accessible GPIO pins.
Signed-off-by: robert-hh <robert@hammelrath.com>
Diffstat (limited to 'ports/samd/main.c')
| -rw-r--r-- | ports/samd/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ports/samd/main.c b/ports/samd/main.c index 1e30df13d..74eb5e328 100644 --- a/ports/samd/main.c +++ b/ports/samd/main.c @@ -81,12 +81,18 @@ void samd_main(void) { soft_reset_exit: mp_printf(MP_PYTHON_PRINTER, "MPY: soft reboot\n"); + #if MICROPY_PY_MACHINE_ADC adc_deinit_all(); + #endif pin_irq_deinit_all(); + #if MICROPY_PY_MACHINE_PWM pwm_deinit_all(); + #endif soft_timer_deinit(); gc_sweep_all(); + #if MICROPY_PY_MACHINE_I2C || MICROPY_PY_MACHINE_SPI || MICROPY_PY_MACHINE_UART sercom_deinit_all(); + #endif mp_deinit(); } } |
