@@ -257,13 +257,13 @@ bool shared_module_bitbangio_spi_transfer(bitbangio_spi_obj_t *self, const uint8
257
257
for (size_t i = 0 ; i < len ; ++ i ) {
258
258
uint8_t data_out = dout [i ];
259
259
uint8_t data_in = 0 ;
260
- for (int j = 0 ; j < 8 ; ++ j , data_out <<= 1 ) {
261
- common_hal_digitalio_digitalinout_set_value (& self -> mosi , (data_out >> 7 ) & 1 );
262
- common_hal_digitalio_digitalinout_set_value (& self -> clock , 1 - self -> polarity );
263
- data_in = (data_in << 1 ) | common_hal_digitalio_digitalinout_get_value (& self -> miso );
264
- common_hal_digitalio_digitalinout_set_value (& self -> clock , self -> polarity );
265
- }
266
- din [i ] = data_in ;
260
+ for (int j = 0 ; j < 8 ; ++ j , data_out <<= 1 ) {
261
+ common_hal_digitalio_digitalinout_set_value (& self -> mosi , (data_out >> 7 ) & 1 );
262
+ common_hal_digitalio_digitalinout_set_value (& self -> clock , 1 - self -> polarity );
263
+ data_in = (data_in << 1 ) | common_hal_digitalio_digitalinout_get_value (& self -> miso );
264
+ common_hal_digitalio_digitalinout_set_value (& self -> clock , self -> polarity );
265
+ }
266
+ din [i ] = data_in ;
267
267
268
268
if (dest != NULL ) {
269
269
dest [i ] = data_in ;
@@ -279,20 +279,20 @@ bool shared_module_bitbangio_spi_transfer(bitbangio_spi_obj_t *self, const uint8
279
279
for (int j = 0 ; j < 8 ; ++ j , data_out <<= 1 ) {
280
280
common_hal_digitalio_digitalinout_set_value (& self -> mosi , (data_out >> 7 ) & 1 );
281
281
if (self -> phase == 0 ) {
282
- common_hal_mcu_delay_us (delay_half );
283
- common_hal_digitalio_digitalinout_set_value (& self -> clock , 1 - self -> polarity );
284
- } else {
285
- common_hal_digitalio_digitalinout_set_value (& self -> clock , 1 - self -> polarity );
286
- common_hal_mcu_delay_us (delay_half );
287
- }
288
- data_in = (data_in << 1 ) | common_hal_digitalio_digitalinout_get_value (& self -> miso );
289
- if (self -> phase == 0 ) {
290
- common_hal_mcu_delay_us (delay_half );
291
- common_hal_digitalio_digitalinout_set_value (& self -> clock , self -> polarity );
292
- } else {
293
- common_hal_digitalio_digitalinout_set_value (& self -> clock , self -> polarity );
294
- common_hal_mcu_delay_us (delay_half );
295
- }
282
+ common_hal_mcu_delay_us (delay_half );
283
+ common_hal_digitalio_digitalinout_set_value (& self -> clock , 1 - self -> polarity );
284
+ } else {
285
+ common_hal_digitalio_digitalinout_set_value (& self -> clock , 1 - self -> polarity );
286
+ common_hal_mcu_delay_us (delay_half );
287
+ }
288
+ data_in = (data_in << 1 ) | common_hal_digitalio_digitalinout_get_value (& self -> miso );
289
+ if (self -> phase == 0 ) {
290
+ common_hal_mcu_delay_us (delay_half );
291
+ common_hal_digitalio_digitalinout_set_value (& self -> clock , self -> polarity );
292
+ } else {
293
+ common_hal_digitalio_digitalinout_set_value (& self -> clock , self -> polarity );
294
+ common_hal_mcu_delay_us (delay_half );
295
+ }
296
296
}
297
297
din [i ] = data_in ;
298
298
0 commit comments