diff options
Diffstat (limited to 'cc3200/mods/pybspi.c')
-rw-r--r-- | cc3200/mods/pybspi.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/cc3200/mods/pybspi.c b/cc3200/mods/pybspi.c index 75a43ea310..ceddd22804 100644 --- a/cc3200/mods/pybspi.c +++ b/cc3200/mods/pybspi.c @@ -110,13 +110,6 @@ STATIC void pybspi_init (const pyb_spi_obj_t *self) { MAP_SPIEnable(GSPI_BASE); } -STATIC void pybspi_deinit(void) { - MAP_SPIDisable(GSPI_BASE); - MAP_PRCMPeripheralClkDisable(PRCM_GSPI, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK); - // invalidate the baudrate - pyb_spi_obj.baudrate = 0; -} - STATIC void pybspi_tx (pyb_spi_obj_t *self, const void *data) { uint32_t txdata = 0xFFFFFFFF; if (data) { @@ -278,7 +271,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_spi_init_obj, 1, pyb_spi_init); /// \method deinit() /// Turn off the spi bus. STATIC mp_obj_t pyb_spi_deinit(mp_obj_t self_in) { - pybspi_deinit(); + // disable the peripheral + MAP_SPIDisable(GSPI_BASE); + MAP_PRCMPeripheralClkDisable(PRCM_GSPI, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK); + // invalidate the baudrate + pyb_spi_obj.baudrate = 0; // unregister it with the sleep module pybsleep_remove((const mp_obj_t)self_in); return mp_const_none; |