text: /****************************************************************************************************************************
    AsyncWebSynchronization_STM32.h - Dead simple AsyncWebServer for STM32 LAN8720 or built-in LAN8742A Ethernet
    
    For STM32 with LAN8720 (STM32F4/F7) or built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc)
    
    AsyncWebServer_STM32 is a library for the STM32 with LAN8720 or built-in LAN8742A Ethernet WebServer
    
    Based on and modified from ESPAsyncWebServer (https://github.com/me-no-dev/ESPAsyncWebServer)
    Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32
    Licensed under MIT license
   
    Version: 1.4.0
  
    Version Modified By   Date      Comments
    ------- -----------  ---------- -----------
    1.2.3   K Hoang      02/09/2020 Initial coding for STM32 for built-in Ethernet (Nucleo-144, DISCOVERY, etc).
                                    Bump up version to v1.2.3 to sync with ESPAsyncWebServer v1.2.3
    1.2.4   K Hoang      05/09/2020 Add back MD5/SHA1 authentication feature.
    1.2.5   K Hoang      28/12/2020 Suppress all possible compiler warnings. Add examples.
    1.2.6   K Hoang      22/03/2021 Fix dependency on STM32AsyncTCP Library
    1.3.0   K Hoang      14/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
    1.3.1   K Hoang      09/10/2021 Update `platform.ini` and `library.json`
    1.4.0   K Hoang      14/12/2021 Fix base64 encoding of websocket client key and add WebServer progmem support
   *****************************************************************************************************************************/
  
  #pragma once
  
  #ifndef ASYNCWEBSYNCHRONIZATION_STM32_H_
  #define ASYNCWEBSYNCHRONIZATION_STM32_H_
  
  // Synchronisation is only available on ESP32, as the ESP8266 isn't using FreeRTOS by default
  
  #include <AsyncWebServer_STM32.h>
  
  // This is the STM32 version of the Sync Lock which is currently unimplemented
  class AsyncWebLock
  {
  
  public:
    AsyncWebLock() {
    }
  
    ~AsyncWebLock() {
    }
  
    bool lock() const {
      return false;
    }
  
    void unlock() const {
    }
  };
  
  class AsyncWebLockGuard
  {
  private:
    const AsyncWebLock *_lock;
  
  public:
    AsyncWebLockGuard(const AsyncWebLock &l) {
      if (l.lock()) {
        _lock = &l;
      } else {
        _lock = NULL;
      }
    }
  
    ~AsyncWebLockGuard() {
      if (_lock) {
        _lock->unlock();
      }
    }
  };
  
  #endif // ASYNCWEBSYNCHRONIZATION_STM32_H_
  