forked from j3d1/fiatlux
implement syslog via websocket with 1k buffer
This commit is contained in:
parent
7a627ee1f1
commit
5466bceb0e
6 changed files with 139 additions and 18 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "system.h"
|
||||
#include "crc32.h"
|
||||
#include "log.h"
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <sysparam.h>
|
||||
|
|
@ -39,7 +40,7 @@ void system_init_config() {
|
|||
uint32_t num_sectors;
|
||||
sysparam_init(base_addr, 0);
|
||||
if(sysparam_get_info(&base_addr, &num_sectors) != SYSPARAM_OK) {
|
||||
printf("Warning: WiFi config, sysparam not initialized\n");
|
||||
syslog("Warning: WiFi config, sysparam not initialized\n");
|
||||
num_sectors = 0x2000 / sdk_flashchip.sector_size;
|
||||
if(sysparam_create_area(base_addr, num_sectors, true) == SYSPARAM_OK) {
|
||||
sysparam_init(base_addr, 0);
|
||||
|
|
@ -106,13 +107,13 @@ enum return_code system_otaflash_verify_and_switch(uint32_t len, uint32_t hash)
|
|||
rboot_digest_image(otaflash_context.base, min(len, MAX_IMAGE_SIZE), system_otaflash_verify_chunk, &digest);
|
||||
|
||||
if(hash != digest) {
|
||||
printf("OTA failed to verify firmware\r\n");
|
||||
syslog("OTA failed to verify firmware\r\n");
|
||||
return CHECKSUM_MISMATCH;
|
||||
}
|
||||
|
||||
vPortEnterCritical();
|
||||
if(!rboot_set_current_rom(otaflash_context.slot)) {
|
||||
printf("OTA Update failed to set new rboot slot\r\n");
|
||||
syslog("OTA Update failed to set new rboot slot\r\n");
|
||||
vPortExitCritical();
|
||||
return RBOOT_SWITCH_FAILED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue