File tree Expand file tree Collapse file tree
ports/espressif/common-hal/busio Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,11 +72,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
7272 mp_raise_ValueError (MP_ERROR_TEXT ("All SPI peripherals are in use" ));
7373 }
7474
75- self -> mutex = xSemaphoreCreateMutex ();
76- if (self -> mutex == NULL ) {
77- mp_raise_RuntimeError (MP_ERROR_TEXT ("Unable to create lock" ));
78- }
79-
8075 esp_err_t result = spi_bus_initialize (self -> host_id , & bus_config , SPI_DMA_CH_AUTO );
8176 if (result == ESP_ERR_NO_MEM ) {
8277 mp_raise_msg (& mp_type_MemoryError , MP_ERROR_TEXT ("ESP-IDF memory allocation failed" ));
@@ -166,7 +161,7 @@ bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) {
166161 if (common_hal_busio_spi_deinited (self )) {
167162 return false;
168163 }
169- return xSemaphoreTake (self -> mutex , 1 ) == pdTRUE ;
164+ return xSemaphoreTake (self -> mutex , 0 ) == pdTRUE ;
170165}
171166
172167bool common_hal_busio_spi_has_lock (busio_spi_obj_t * self ) {
You can’t perform that action at this time.
0 commit comments