Adapt for LibreTuya compatibility (#3)

This commit is contained in:
Kuba Szczodrzyński
2022-08-09 17:34:14 +12:00
committed by GitHub
parent 7c767c3f6b
commit fb0411b699
3 changed files with 44 additions and 3 deletions
+15 -1
View File
@@ -23,12 +23,22 @@
#define ASYNCTCP_H_
#include "IPAddress.h"
#include "sdkconfig.h"
#include <functional>
#ifndef LIBRETUYA
#include "sdkconfig.h"
extern "C" {
#include "freertos/semphr.h"
#include "lwip/pbuf.h"
}
#else
extern "C" {
#include <semphr.h>
#include <lwip/pbuf.h>
}
#define CONFIG_ASYNC_TCP_RUNNING_CORE -1 //any available core
#define CONFIG_ASYNC_TCP_USE_WDT 0
#endif
//If core is not defined, then we are running in Arduino or PIO
#ifndef CONFIG_ASYNC_TCP_RUNNING_CORE
@@ -36,6 +46,10 @@ extern "C" {
#define CONFIG_ASYNC_TCP_USE_WDT 1 //if enabled, adds between 33us and 200us per event
#endif
#ifndef CONFIG_ASYNC_TCP_STACK_SIZE
#define CONFIG_ASYNC_TCP_STACK_SIZE 8192 * 2
#endif
class AsyncClient;
#define ASYNC_MAX_ACK_TIME 5000