File tree Expand file tree Collapse file tree
ports/stm32f4/common-hal/busio Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,9 +123,9 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
123123 SPIx = mcu_spi_banks [self -> sck -> spi_index - 1 ];
124124 } else {
125125 if (spi_taken ) {
126- mp_raise_RuntimeError (translate ("Hardware busy, try alternative pins" ));
126+ mp_raise_ValueError (translate ("Hardware busy, try alternative pins" ));
127127 } else {
128- mp_raise_RuntimeError (translate ("Invalid SPI pin selection" ));
128+ mp_raise_ValueError (translate ("Invalid SPI pin selection" ));
129129 }
130130 }
131131
@@ -203,7 +203,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
203203 self -> handle .Init .CRCPolynomial = 10 ;
204204 if (HAL_SPI_Init (& self -> handle ) != HAL_OK )
205205 {
206- mp_raise_RuntimeError (translate ("SPI Init Error" ));
206+ mp_raise_ValueError (translate ("SPI Init Error" ));
207207 }
208208 self -> baudrate = (HAL_RCC_GetPCLK2Freq ()/16 );
209209 self -> prescaler = 16 ;
@@ -344,7 +344,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self,
344344
345345 if (HAL_SPI_Init (& self -> handle ) != HAL_OK )
346346 {
347- mp_raise_RuntimeError (translate ("SPI Re-initialization error" ));
347+ mp_raise_ValueError (translate ("SPI Re-initialization error" ));
348348 }
349349
350350 self -> baudrate = baudrate ;
You can’t perform that action at this time.
0 commit comments