initial commit

This commit is contained in:
2024-12-15 00:34:01 +06:00
commit 31efbc726f
1576 changed files with 657692 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#if defined(CONFIG_PLATFORM_8711B)
#include "rtl8710b_ota.h"
#include <FreeRTOS.h>
#include <task.h>
#else
#include <ota_8195a.h>
#endif
#define PORT 8082
#define HOST "192.168.1.53" //"m-apps.oss-cn-shenzhen.aliyuncs.com"
#define RESOURCE "" //"051103061600.bin"
#ifdef HTTP_OTA_UPDATE
void http_update_ota_task(void *param){
printf("\n\r\n\r\n\r\n\r<<<<<<Waiting for 1 minute to connect Wi-Fi>>>>>>>\n\r\n\r\n\r\n\r");
vTaskDelay(60*1000);
int ret = -1;
ret = http_update_ota(HOST, PORT, RESOURCE);
exit:
printf("\n\r[%s] Update task exit", __FUNCTION__);
if(!ret){
printf("\n\r[%s] Ready to reboot", __FUNCTION__);
ota_platform_reset();
}
vTaskDelete(NULL);
}
void example_ota_http(void){
if(xTaskCreate(http_update_ota_task, (char const *)"http_update_ota_task", 1024, NULL, tskIDLE_PRIORITY + 1, NULL) != pdPASS){
printf("\n\r[%s] Create update task failed", __FUNCTION__);
}
}
#endif

View File

@@ -0,0 +1,6 @@
#ifndef EXAMPLE_OTA_HTTP_H
#define EXAMPLE_OTA_HTTP_H
void example_ota_http(void);
#endif /* EXAMPLE_OTA_HTTP_H */

View File

@@ -0,0 +1,23 @@
OTA HTTP UPDATING EXAMPLE
Description:
Download ota.bin from http download server(in tools\DownloadServer(HTTP))
Configuration:
[example_ota_http.c]
Modify PORT, HOST and RESOURCE based on your HTTP download server.
eg: SERVER: http://m-apps.oss-cn-shenzhen.aliyuncs.com/051103061600.bin
set: #define PORT 80
#define HOST "m-apps.oss-cn-shenzhen.aliyuncs.com"
#define RESOURCE "051103061600.bin"
[platform_opts.h]
#define CONFIG_EXAMPLE_OTA_HTTP 1
[ota_8195a.h for Ameba1, rtl8710b_ota.h for AmebaZ]
#define HTTP_OTA_UPDATE
Execution:
Can make automatical Wi-Fi connection when booting by using wlan fast connect example.
A http download example thread will be started automatically when booting.
Using the example with the tool in tools\DownloadServer(HTTP)