diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index d6fc6a189..b6309ccd7 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -33,6 +33,8 @@ static char SUBMIT_AND_END_FORM[] = "
", i + 1, (int)num, ar[i].ssid, ar[i].channel, ar[i].rssi); } tuya_os_adapt_wifi_release_ap(ar); +#elif PLATFORM_LN882H +// TODO:LN882H action + poststr(request, "TODO LN882H
"); #else #error "Unknown platform" poststr(request, "Unknown platform
"); diff --git a/src/httpserver/rest_interface.c b/src/httpserver/rest_interface.c index fcd73b84a..db308fc7c 100644 --- a/src/httpserver/rest_interface.c +++ b/src/httpserver/rest_interface.c @@ -45,6 +45,8 @@ uint32_t flash_read(uint32_t flash, uint32_t addr, void* buf, uint32_t size); #elif PLATFORM_W800 +#elif PLATFORM_LN882H + #else extern UINT32 flash_read(char* user_buf, UINT32 count, UINT32 address); @@ -1519,6 +1521,9 @@ static int http_rest_get_flash(http_request_t* request, int startaddr, int len) res = 0; #elif PLATFORM_W600 || PLATFORM_W800 res = 0; +#elif PLATFORM_LN882H +// TODO:LN882H flash read? + res = 0; #else res = flash_read((char*)buffer, readlen, startaddr); #endif diff --git a/src/new_common.h b/src/new_common.h index 70bcc3819..4e0998d13 100644 --- a/src/new_common.h +++ b/src/new_common.h @@ -70,6 +70,11 @@ void OTA_RequestDownloadFromHTTP(const char *s); typedef long BaseType_t; +#elif PLATFORM_LN882H +#define DEVICENAME_PREFIX_FULL "OpenLN882H" +#define DEVICENAME_PREFIX_SHORT "ln882h" +#define PLATFORM_MCU_NAME "LN882H" +#define MANUFACTURER "LightningSemi" #else #error "You must define a platform.." This platform is not supported, error! @@ -93,6 +98,8 @@ This platform is not supported, error! #define USER_SW_VER "W600_Test" #elif defined(PLATFORM_W800) #define USER_SW_VER "W800_Test" +#elif defined(PLATFORM_LN882H) +#define USER_SW_VER "LN882H_Test" #else #define USER_SW_VER "unknown" #endif @@ -313,6 +320,38 @@ OSStatus rtos_create_thread( beken_thread_t* thread, uint32_t stack_size, beken_thread_arg_t arg ); +#elif PLATFORM_LN882H + +// TODO:LN882H Platform setup here. +typedef int bool; +#define true 1 +#define false 0 + +#define ASSERT +#define os_strcpy strcpy +#define os_malloc malloc +#define os_free free +#define os_memset memset + +#define bk_printf printf + +#define kNoErr 0 //! No error occurred. +#define rtos_delay_milliseconds OS_MsDelay +typedef void *beken_thread_arg_t; +typedef void *beken_thread_t; +typedef void (*beken_thread_function_t)( beken_thread_arg_t arg ); +typedef int OSStatus; + +#define BEKEN_DEFAULT_WORKER_PRIORITY (6) +#define BEKEN_APPLICATION_PRIORITY (7) + +// wrappers for XR809??? threads to work like bekken +OSStatus rtos_delete_thread( beken_thread_t* thread ); +OSStatus rtos_create_thread( beken_thread_t* thread, + uint8_t priority, const char* name, + beken_thread_function_t function, + uint32_t stack_size, beken_thread_arg_t arg ); + #else #include "gw_intf.h" diff --git a/src/obk_config.h b/src/obk_config.h index b725dbb6c..51a85015e 100644 --- a/src/obk_config.h +++ b/src/obk_config.h @@ -96,6 +96,10 @@ #define ENABLE_DRIVER_PWM_GROUP 1 #endif +#elif PLATFORM_LN882H + +#define OBK_DISABLE_ALL_DRIVERS 1 + #else #error "Platform not defined"