diff --git a/src/hal/xr809/hal_main_xr809.c b/src/hal/xr809/hal_main_xr809.c index 2fb564189..6417baefb 100644 --- a/src/hal/xr809/hal_main_xr809.c +++ b/src/hal/xr809/hal_main_xr809.c @@ -1,4 +1,4 @@ -#ifdef PLATFORM_XR809 +#if PLATFORM_XR809 || PLATFORM_XR872 #include "../../new_common.h" #include "../../logging/logging.h" diff --git a/src/hal/xr809/hal_wifi_xr809.c b/src/hal/xr809/hal_wifi_xr809.c index 39f5a08a0..91a68fddb 100644 --- a/src/hal/xr809/hal_wifi_xr809.c +++ b/src/hal/xr809/hal_wifi_xr809.c @@ -1,4 +1,4 @@ -#ifdef PLATFORM_XR809 +#if PLATFORM_XR809 || PLATFORM_XR872 #include "../hal_wifi.h" #include "../../new_cfg.h" @@ -14,7 +14,7 @@ #include "common/framework/platform_init.h" #include "common/framework/sysinfo.h" #include "common/framework/net_ctrl.h" -#include "serial.h" +//#include "serial.h" #include "kernel/os/os.h" #include "lwip/sockets.h" @@ -82,11 +82,13 @@ static void wlan_msg_recv(uint32_t event, uint32_t data, void *arg) g_wifiStatusCallback(WIFI_STA_DISCONNECTED); } break; +#if !PLATFORM_XR872 case NET_CTRL_MSG_CONNECTION_LOSS: if(g_wifiStatusCallback!=0) { g_wifiStatusCallback(WIFI_STA_DISCONNECTED); } break; +#endif case NET_CTRL_MSG_NETWORK_UP: break; diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index 8000062a8..9581c9902 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -3150,6 +3150,8 @@ void OTA_RequestDownloadFromHTTP(const char* s) { t_http_fwup(s); #elif PLATFORM_XR809 XR809_RequestOTAHTTP(s); +#elif PLATFORM_XR872 + #else otarequest(s); #endif diff --git a/src/httpserver/http_tcp_server.c b/src/httpserver/http_tcp_server.c index b6502efa3..101109b48 100644 --- a/src/httpserver/http_tcp_server.c +++ b/src/httpserver/http_tcp_server.c @@ -28,7 +28,7 @@ #ifdef CREATE_THREAD_PER_EACH_HTTP_CLIENT -#if PLATFORM_XR809 +#if PLATFORM_XR809 || PLATFORM_XR872 #define DISABLE_SEPARATE_THREAD_FOR_EACH_TCP_CLIENT 1 diff --git a/src/httpserver/rest_interface.c b/src/httpserver/rest_interface.c index e7b339ece..7d24f77cd 100644 --- a/src/httpserver/rest_interface.c +++ b/src/httpserver/rest_interface.c @@ -1620,6 +1620,10 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa return 0; //Operation not supported yet #endif +#if PLATFORM_XR872 + return 0; //Operation not supported yet +#endif + int total = 0; int towrite = request->bodylen; @@ -3178,6 +3182,8 @@ static int http_rest_get_flash(http_request_t* request, int startaddr, int len) //uint32_t flash_read(uint32_t flash, uint32_t addr,void *buf, uint32_t size) #define FLASH_INDEX_XR809 0 res = flash_read(FLASH_INDEX_XR809, startaddr, buffer, readlen); +#elif PLATFORM_XR872 + res = 0; #elif PLATFORM_BL602 res = bl_flash_read(startaddr, (uint8_t *)buffer, readlen); #elif PLATFORM_W600 || PLATFORM_W800 diff --git a/src/new_common.h b/src/new_common.h index c03a77778..810040399 100644 --- a/src/new_common.h +++ b/src/new_common.h @@ -53,6 +53,11 @@ void OTA_RequestDownloadFromHTTP(const char *s); #define DEVICENAME_PREFIX_SHORT "oxr" #define PLATFORM_MCU_NAME "XR809" #define MANUFACTURER "Xradio Technology" +#elif PLATFORM_XR872 +#define DEVICENAME_PREFIX_FULL "OpenXR872" +#define DEVICENAME_PREFIX_SHORT "oxr" +#define PLATFORM_MCU_NAME "XR872" +#define MANUFACTURER "Xradio Technology" #elif PLATFORM_BK7231N #define DEVICENAME_PREFIX_FULL "OpenBK7231N" #define DEVICENAME_PREFIX_SHORT "obk" @@ -350,7 +355,7 @@ OSStatus rtos_suspend_thread(beken_thread_t* thread); typedef unsigned int u32; -#elif PLATFORM_XR809 +#elif PLATFORM_XR809 || PLATFORM_XR872 diff --git a/src/obk_config.h b/src/obk_config.h index 7efa18855..396c5cf4b 100644 --- a/src/obk_config.h +++ b/src/obk_config.h @@ -28,6 +28,11 @@ #define NO_CHIP_TEMPERATURE 1 #define OBK_DISABLE_ALL_DRIVERS 1 +#elif PLATFORM_XR872 + +#define NO_CHIP_TEMPERATURE 1 +#define OBK_DISABLE_ALL_DRIVERS 1 + #elif PLATFORM_W600 // parse things like $CH1 or $hour etc diff --git a/src/user_main.c b/src/user_main.c index 3e6fa9477..2d3d93be2 100644 --- a/src/user_main.c +++ b/src/user_main.c @@ -106,7 +106,7 @@ int DRV_SSDP_Active = 0; void Main_ForceUnsafeInit(); -#if PLATFORM_XR809 +#if PLATFORM_XR809 || PLATFORM_XR872 size_t xPortGetFreeHeapSize() { return 0; } @@ -208,7 +208,7 @@ void extended_app_waiting_for_launch2(void) { #endif -#if defined(PLATFORM_LN882H) || defined(PLATFORM_ESPIDF) +#if defined(PLATFORM_LN882H) || defined(PLATFORM_ESPIDF) || defined(PLATFORM_XR872) int LWIP_GetMaxSockets() { return 0; @@ -666,7 +666,7 @@ void Main_OnEverySecond() #if WINDOWS #elif PLATFORM_BL602 #elif PLATFORM_W600 || PLATFORM_W800 -#elif PLATFORM_XR809 +#elif PLATFORM_XR809 || PLATFORM_XR872 #elif PLATFORM_BK7231N || PLATFORM_BK7231T if (ota_progress() == -1) #endif @@ -1054,7 +1054,7 @@ void quick_timer_thread(void* param) } #elif PLATFORM_ESPIDF esp_timer_handle_t g_quick_timer; -#elif PLATFORM_XR809 || PLATFORM_LN882H +#elif PLATFORM_XR809 || PLATFORM_LN882H || PLATFORM_XR872 OS_Timer_t g_quick_timer; #else beken_timer_t g_quick_timer; @@ -1074,7 +1074,7 @@ void QuickTick_StartThread(void) esp_timer_create(&g_quick_timer_args, &g_quick_timer); esp_timer_start_periodic(g_quick_timer, QUICK_TMR_DURATION * 1000); -#elif PLATFORM_XR809 || PLATFORM_LN882H +#elif PLATFORM_XR809 || PLATFORM_LN882H || PLATFORM_XR872 OS_TimerSetInvalid(&g_quick_timer); if (OS_TimerCreate(&g_quick_timer, OS_TIMER_PERIODIC, QuickTick, NULL,