diff options
| author | Dan Halbert <halbert@halwitz.org> | 2018-05-24 20:20:18 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2018-05-24 20:20:18 -0400 |
| commit | ee896cdd41f9c3f3ca4fdc7c08b8e24caabe950b (patch) | |
| tree | 8cd2c31faa2d167bc80f2baae423fc295a9042ac | |
| parent | b9f36184f57264926230e31096ea0321c6de9382 (diff) | |
restore I2C and UART. Don't do port.c resets and inits for modules that are not available.
| -rw-r--r-- | ports/atmel-samd/supervisor/port.c | 12 | ||||
| -rw-r--r-- | shared-bindings/busio/__init__.c | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index cd122843d..8571348fb 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -190,7 +190,10 @@ safe_mode_t port_init(void) { // Configure millisecond timer initialization. tick_init(); + +#ifndef PIRKEY_M0 rtc_init(); +#endif // Init the nvm controller. // struct nvm_config config_nvm; @@ -249,18 +252,19 @@ void reset_port(void) { pulsein_reset(); pulseout_reset(); pwmout_reset(); + +#ifndef PIRKEY_M0 + analogin_reset(); + analogout_reset(); rtc_reset(); +#endif reset_gclks(); - analogin_reset(); - #ifdef CIRCUITPY_GAMEPAD_TICKS gamepad_reset(); #endif - analogout_reset(); - reset_event_system(); reset_all_pins(); diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index 0ed0bf22d..958ee062a 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -87,13 +87,10 @@ STATIC const mp_rom_map_elem_t busio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_busio) }, - { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&busio_spi_type) }, -// a pIRKey does not need these. Remove them to make room for frozen modules. -#ifndef PIRKEY_M0 { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&busio_i2c_type) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&busio_spi_type) }, { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&busio_onewire_type) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&busio_uart_type) }, -#endif }; STATIC MP_DEFINE_CONST_DICT(busio_module_globals, busio_module_globals_table); |
