Skip to content

Commit eaa6c27

Browse files
committed
working on being able to share the SPI Bus
1 parent 56e23f8 commit eaa6c27

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

micropy_updates/esp32/machine_sdcard.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,16 @@ static mp_obj_t machine_sdcard_make_new(const mp_obj_type_t *type, size_t n_args
170170
);
171171

172172
bool is_spi;
173+
int slot_num;
173174

174175
if (args[ARG_spi_bus].u_obj != mp_const_none) {
175176
micropy_sd_spi_obj_t *spi_bus = MP_OBJ_TO_PTR(args[ARG_spi_bus].u_obj);
176-
int cs = args[ARG_cs].u_int
177-
int slot_num = (int)spi_bus->spi_bus->host;
177+
slot_num = (int)spi_bus->spi_bus->host;
178178
is_spi = true;
179179
} else {
180-
int slot_num = args[ARG_slot].u_int;
181-
180+
slot_num = args[ARG_slot].u_int;
182181
is_spi = false
182+
183183
if (slot_num < 0 || slot_num > 3) {
184184
mp_raise_ValueError(MP_ERROR_TEXT("slot number must be between 0 and 3 inclusive"));
185185
}

0 commit comments

Comments
 (0)