@@ -84,15 +84,15 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
84
84
uint8_t miso_len = sizeof (mcu_spi_miso_list )/sizeof (* mcu_spi_miso_list );
85
85
bool spi_taken = false;
86
86
87
- //sck is not optional. MOSI and MISO are
87
+ //SCK is not optional. MOSI and MISO are
88
88
for (uint i = 0 ; i < sck_len ;i ++ ) {
89
89
if (mcu_spi_sck_list [i ].pin == sck ) {
90
- //if both mosi and miso exist, loop search normally
90
+ //if both MOSI and MISO exist, loop search normally
91
91
if ((mosi != mp_const_none ) && (miso != mp_const_none )) {
92
- //mosi
92
+ //MOSI
93
93
for (uint j = 0 ; j < mosi_len ;j ++ ) {
94
94
if (mcu_spi_mosi_list [j ].pin == mosi ) {
95
- //miso
95
+ //MISO
96
96
for (uint k = 0 ; k < miso_len ;k ++ ) {
97
97
if ((mcu_spi_miso_list [k ].pin == miso ) //everything needs the same index
98
98
&& (mcu_spi_sck_list [i ].spi_index == mcu_spi_mosi_list [j ].spi_index )
@@ -111,10 +111,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
111
111
}
112
112
}
113
113
}
114
- // if just miso , reduce search
114
+ // if just MISO , reduce search
115
115
} else if (miso != mp_const_none ) {
116
116
for (uint j = 0 ; j < miso_len ;j ++ ) {
117
- if ((mcu_spi_miso_list [j ].pin == miso ) //only sck and miso need the same index
117
+ if ((mcu_spi_miso_list [j ].pin == miso ) //only SCK and MISO need the same index
118
118
&& (mcu_spi_sck_list [i ].spi_index == mcu_spi_miso_list [j ].spi_index )) {
119
119
//keep looking if the SPI is taken, edge case
120
120
if (reserved_spi [mcu_spi_sck_list [i ].spi_index - 1 ]) {
@@ -128,10 +128,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
128
128
break ;
129
129
}
130
130
}
131
- // if just mosi , reduce search
131
+ // if just MOSI , reduce search
132
132
} else if (mosi != mp_const_none ) {
133
133
for (uint j = 0 ; j < mosi_len ;j ++ ) {
134
- if ((mcu_spi_mosi_list [j ].pin == mosi ) //only sck and mosi need the same index
134
+ if ((mcu_spi_mosi_list [j ].pin == mosi ) //only SCK and MOSI need the same index
135
135
&& (mcu_spi_sck_list [i ].spi_index == mcu_spi_mosi_list [j ].spi_index )) {
136
136
//keep looking if the SPI is taken, edge case
137
137
if (reserved_spi [mcu_spi_sck_list [i ].spi_index - 1 ]) {
@@ -197,7 +197,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
197
197
198
198
self -> handle .Instance = SPIx ;
199
199
self -> handle .Init .Mode = SPI_MODE_MASTER ;
200
- // Direction change only required for RX only, see RefMan RM0090:884
200
+ // Direction change only required for RX- only, see RefMan RM0090:884
201
201
self -> handle .Init .Direction = (self -> mosi == NULL ) ? SPI_CR1_RXONLY : SPI_DIRECTION_2LINES ;
202
202
self -> handle .Init .DataSize = SPI_DATASIZE_8BIT ;
203
203
self -> handle .Init .CLKPolarity = SPI_POLARITY_LOW ;
0 commit comments