소스 검색

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;