Skip to content

Commit d645ea2

Browse files
committed
Text fixes for consistency
1 parent 6ab75fe commit d645ea2

File tree

1 file changed

+9
-9
lines changed
  • ports/stm32f4/common-hal/busio

1 file changed

+9
-9
lines changed

ports/stm32f4/common-hal/busio/SPI.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
8484
uint8_t miso_len = sizeof(mcu_spi_miso_list)/sizeof(*mcu_spi_miso_list);
8585
bool spi_taken = false;
8686

87-
//sck is not optional. MOSI and MISO are
87+
//SCK is not optional. MOSI and MISO are
8888
for(uint i=0; i<sck_len;i++) {
8989
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
9191
if ((mosi != mp_const_none) && (miso != mp_const_none)) {
92-
//mosi
92+
//MOSI
9393
for(uint j=0; j<mosi_len;j++) {
9494
if (mcu_spi_mosi_list[j].pin == mosi) {
95-
//miso
95+
//MISO
9696
for(uint k=0; k<miso_len;k++) {
9797
if ((mcu_spi_miso_list[k].pin == miso) //everything needs the same index
9898
&& (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,
111111
}
112112
}
113113
}
114-
// if just miso, reduce search
114+
// if just MISO, reduce search
115115
} else if (miso != mp_const_none) {
116116
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
118118
&& (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[j].spi_index)) {
119119
//keep looking if the SPI is taken, edge case
120120
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,
128128
break;
129129
}
130130
}
131-
// if just mosi, reduce search
131+
// if just MOSI, reduce search
132132
} else if (mosi != mp_const_none) {
133133
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
135135
&& (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index)) {
136136
//keep looking if the SPI is taken, edge case
137137
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,
197197

198198
self->handle.Instance = SPIx;
199199
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
201201
self->handle.Init.Direction = (self->mosi == NULL) ? SPI_CR1_RXONLY : SPI_DIRECTION_2LINES;
202202
self->handle.Init.DataSize = SPI_DATASIZE_8BIT;
203203
self->handle.Init.CLKPolarity = SPI_POLARITY_LOW;

0 commit comments

Comments
 (0)