py/obj: Add accessors for type slots and use everywhere.

This is a no-op, but sets the stage for changing the mp_obj_type_t
representation.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2021-07-14 17:14:16 +10:00
committed by Damien George
parent e8355eb163
commit a52cd5b07d
27 changed files with 207 additions and 188 deletions

View File

@@ -137,7 +137,7 @@ int nina_bsp_spi_slave_deselect(void) {
int nina_bsp_spi_transfer(const uint8_t *tx_buf, uint8_t *rx_buf, uint32_t size) {
mp_obj_t mp_wifi_spi = MP_STATE_PORT(mp_wifi_spi);
((mp_machine_spi_p_t *)machine_spi_type.protocol)->transfer(mp_wifi_spi, size, tx_buf, rx_buf);
((mp_machine_spi_p_t *)MP_OBJ_TYPE_GET_SLOT(&machine_spi_type, protocol))->transfer(mp_wifi_spi, size, tx_buf, rx_buf);
#if NINA_DEBUG
for (int i = 0; i < size; i++) {
if (tx_buf) {