File tree Expand file tree Collapse file tree 2 files changed +2
-16
lines changed
ports/nrf/common-hal/busio Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ void i2c_reset(void) {
63
63
if (never_reset [i ]) {
64
64
continue ;
65
65
}
66
- nrf_twim_disable ( twim_peripherals [i ].twim . p_twim );
66
+ nrfx_twim_uninit ( & twim_peripherals [i ].twim );
67
67
twim_peripherals [i ].in_use = false;
68
68
}
69
69
}
@@ -150,13 +150,6 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *
150
150
// About to init. If we fail after this point, common_hal_busio_i2c_deinit() will set in_use to false.
151
151
self -> twim_peripheral -> in_use = true;
152
152
nrfx_err_t err = nrfx_twim_init (& self -> twim_peripheral -> twim , & config , NULL , NULL );
153
-
154
- // A soft reset doesn't uninit the driver so we might end up with a invalid state
155
- if (err == NRFX_ERROR_INVALID_STATE ) {
156
- nrfx_twim_uninit (& self -> twim_peripheral -> twim );
157
- err = nrfx_twim_init (& self -> twim_peripheral -> twim , & config , NULL , NULL );
158
- }
159
-
160
153
if (err != NRFX_SUCCESS ) {
161
154
common_hal_busio_i2c_deinit (self );
162
155
mp_raise_OSError (MP_EIO );
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ void spi_reset(void) {
68
68
if (never_reset [i ]) {
69
69
continue ;
70
70
}
71
- nrf_spim_disable ( spim_peripherals [i ].spim . p_reg );
71
+ nrfx_spim_uninit ( & spim_peripherals [i ].spim );
72
72
}
73
73
}
74
74
@@ -160,13 +160,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *
160
160
}
161
161
162
162
nrfx_err_t err = nrfx_spim_init (& self -> spim_peripheral -> spim , & config , NULL , NULL );
163
-
164
- // A soft reset doesn't uninit the driver so we might end up with a invalid state
165
- if (err == NRFX_ERROR_INVALID_STATE ) {
166
- nrfx_spim_uninit (& self -> spim_peripheral -> spim );
167
- err = nrfx_spim_init (& self -> spim_peripheral -> spim , & config , NULL , NULL );
168
- }
169
-
170
163
if (err != NRFX_SUCCESS ) {
171
164
common_hal_busio_spi_deinit (self );
172
165
mp_raise_OSError (MP_EIO );
You can’t perform that action at this time.
0 commit comments