瀏覽代碼

Avoid GPIO map lock for board profile requests

SybexXx 3 天之前
父節點
當前提交
dd3476eb7d
共有 1 個文件被更改,包括 2 次插入 和 1 次删除
  1. 2 1
      code/components/jomjol_controlGPIO/server_GPIO.cpp

+ 2 - 1
code/components/jomjol_controlGPIO/server_GPIO.cpp

@@ -735,7 +735,6 @@ void GpioHandler::registerGpioUri()
 
 esp_err_t GpioHandler::handleHttpRequest(httpd_req_t *req)
 {
-    std::lock_guard<std::recursive_mutex> lock(_mapMutex);
     ESP_LOGD(TAG, "handleHttpRequest");
 
     char _query[200];
@@ -772,6 +771,8 @@ esp_err_t GpioHandler::handleHttpRequest(httpd_req_t *req)
         }
     }
 
+    std::lock_guard<std::recursive_mutex> lock(_mapMutex);
+
     if (gpioMap == NULL) {
         httpd_resp_sendstr(req, "GPIO handler not initialized");
         return ESP_OK;