diff --git a/src/SystemConfiguration.c b/src/SystemConfiguration.c index c9f2e1c..029e9be 100644 --- a/src/SystemConfiguration.c +++ b/src/SystemConfiguration.c @@ -57,11 +57,10 @@ static SYS_CONFIG SysConfig; -#define SPI_LOCK_TIMEOUT_MS (1000) + #define NETWORK_START_TIMEOUT (60) -SemaphoreHandle_t xSemaphoreSPIHandle = NULL; -StaticSemaphore_t xSemaphoreSPIBuf; + static int NetworkStartTimeout = 0; static bool isUserAppNeedReset = false; @@ -181,33 +180,12 @@ static void InitSysIO(void) } -void spi_device_init_custom(void) -{ - xSemaphoreSPIHandle = xSemaphoreCreateBinaryStatic(&xSemaphoreSPIBuf); - xSemaphoreGive(xSemaphoreSPIHandle); -} - -esp_err_t spi_device_polling_transmit_synchronized(spi_device_handle_t handle, spi_transaction_t *trans_desc) -{ - esp_err_t res; - if (xSemaphoreTake(xSemaphoreSPIHandle,pdMS_TO_TICKS(SPI_LOCK_TIMEOUT_MS)) == pdTRUE) - { - res = spi_device_polling_transmit(handle, trans_desc); - xSemaphoreGive(xSemaphoreSPIHandle); - } - else - { - res = ESP_ERR_TIMEOUT; - } - return res; -} - static void InitSysSPI(void) { #ifdef CONFIG_WEBGUIAPP_SPI_ENABLE - spi_device_init_custom(); + //spi_device_init_custom(); spi_bus_config_t buscfg = { .miso_io_num = CONFIG_SPI_MISO_GPIO, .mosi_io_num = CONFIG_SPI_MOSI_GPIO,