mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-03-05 23:17:43 +00:00
TXW817 support (#1779)
* txw81x base no makefile * txw81x * gpio fix? * non-working ota * mic
This commit is contained in:
committed by
GitHub
parent
948237869f
commit
0d007112b1
@ -1833,8 +1833,13 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) {
|
||||
ledDriverChipRunning = 0;
|
||||
#endif
|
||||
|
||||
#if PLATFORM_TXW81X
|
||||
hooks.malloc_fn = _os_malloc;
|
||||
hooks.free_fn = _os_free;
|
||||
#else
|
||||
hooks.malloc_fn = os_malloc;
|
||||
hooks.free_fn = os_free;
|
||||
#endif
|
||||
cJSON_InitHooks(&hooks);
|
||||
|
||||
DRV_OnHassDiscovery(topic);
|
||||
|
||||
@ -35,11 +35,11 @@ void HTTPServer_Start();
|
||||
typedef struct
|
||||
{
|
||||
int fd;
|
||||
xTaskHandle thread;
|
||||
beken_thread_t thread;
|
||||
bool isCompleted;
|
||||
} tcp_thread_t;
|
||||
|
||||
static xTaskHandle g_http_thread = NULL;
|
||||
static beken_thread_t g_http_thread = NULL;
|
||||
static const size_t max_socks = MAX_SOCKETS_TCP - 1;
|
||||
static int listen_sock = INVALID_SOCK;
|
||||
static tcp_thread_t sock[MAX_SOCKETS_TCP - 1] =
|
||||
@ -178,7 +178,7 @@ void HTTPServer_Stop(void* arg)
|
||||
void restart_tcp_server(void* arg)
|
||||
{
|
||||
HTTPServer_Start();
|
||||
vTaskDelete(NULL);
|
||||
rtos_delete_thread(NULL);
|
||||
}
|
||||
|
||||
static void tcp_server_thread(beken_thread_arg_t arg)
|
||||
@ -329,13 +329,11 @@ error:
|
||||
}
|
||||
}
|
||||
rtos_delay_milliseconds(2000);
|
||||
xTaskCreate(
|
||||
(TaskFunction_t)restart_tcp_server,
|
||||
rtos_create_thread(NULL, BEKEN_APPLICATION_PRIORITY,
|
||||
"TCP Restart",
|
||||
2048 / sizeof(StackType_t),
|
||||
NULL,
|
||||
BEKEN_APPLICATION_PRIORITY,
|
||||
NULL);
|
||||
(beken_thread_function_t)restart_tcp_server,
|
||||
2048,
|
||||
(beken_thread_arg_t)0);
|
||||
}
|
||||
|
||||
void HTTPServer_Start()
|
||||
|
||||
@ -202,6 +202,8 @@ static int http_rest_post(http_request_t* request) {
|
||||
r = http_rest_post_flash(request, -1, -1);
|
||||
#elif PLATFORM_XRADIO && !PLATFORM_XR809
|
||||
r = http_rest_post_flash(request, 0, -1);
|
||||
#elif PLATFORM_TXW81X
|
||||
r = http_rest_post_flash(request, 0, -1);
|
||||
#else
|
||||
// TODO
|
||||
ADDLOG_ERROR(LOG_FEATURE_API, "No OTA");
|
||||
|
||||
Reference in New Issue
Block a user