udpate v71 program

This commit is contained in:
Steven Dan
2026-05-18 15:46:55 +08:00
parent bcd51be853
commit 56cf9b6c4e
3 changed files with 24 additions and 3 deletions

View File

@@ -213,7 +213,7 @@ set(APP_COMPILER_FLAGS_br_uac2 ${SW_USB_A
-DDEFAULT_FREQ=\(48000\) -DDEFAULT_FREQ=\(48000\)
-DUAC1=1 -DUAC1=1
-DTHREE_AUDIO=1 -DTHREE_AUDIO=1
-lxmos_fps #-lxmos_fps
-DHID_CONTROLS=1 -DHID_CONTROLS=1
-DBR_ALGO=1 -DBR_ALGO=1
-lbr -lbr

View File

@@ -11,6 +11,10 @@
#include "rtos_qspi_flash.h" #include "rtos_qspi_flash.h"
#include "swlock.h" #include "swlock.h"
#include "debug_print.h" #include "debug_print.h"
#include "uac_hwresources.h"
#if HID_DFU_EN
#include "dfu_upgrade.h"
#endif
// variables used by the filesystem // variables used by the filesystem
lfs_t lfs; lfs_t lfs;
lfs_file_t file; lfs_file_t file;
@@ -167,6 +171,14 @@ int lfs_format_all(void) {
#pragma stackfunction 1500 #pragma stackfunction 1500
void lfs_read_config(unsigned char * config, unsigned char * buffer, unsigned size) void lfs_read_config(unsigned char * config, unsigned char * buffer, unsigned size)
{ {
// 改动原因升级过程中禁止Flash读操作
#if HID_DFU_EN
if (firmware_upgrade_get_state() != UPGRADE_IDLE) {
debug_printf("lfs_read_config blocked during firmware upgrade\n");
return;
}
#endif
debug_printf("lfs_read_config: %s, size: %d\n", config, size); debug_printf("lfs_read_config: %s, size: %d\n", config, size);
int result = lfs_file_open(&lfs, &file, config, LFS_O_RDWR | LFS_O_CREAT); int result = lfs_file_open(&lfs, &file, config, LFS_O_RDWR | LFS_O_CREAT);
debug_printf("lfs_read_config: %s, result: %d\n", config, result); debug_printf("lfs_read_config: %s, result: %d\n", config, result);
@@ -189,6 +201,14 @@ void lfs_read_config(unsigned char * config, unsigned char * buffer, unsigned si
#pragma stackfunction 1500 #pragma stackfunction 1500
void lfs_write_config(unsigned char * config, unsigned char * buffer, unsigned size) void lfs_write_config(unsigned char * config, unsigned char * buffer, unsigned size)
{ {
// 改动原因升级过程中禁止Flash写操作
#if HID_DFU_EN
if (firmware_upgrade_get_state() != UPGRADE_IDLE) {
debug_printf("lfs_write_config blocked during firmware upgrade\n");
return;
}
#endif
debug_printf("lfs_write_config: %s, size: %d\n", config, size); debug_printf("lfs_write_config: %s, size: %d\n", config, size);
int result = lfs_file_open(&lfs, &file, config, LFS_O_RDWR | LFS_O_CREAT); int result = lfs_file_open(&lfs, &file, config, LFS_O_RDWR | LFS_O_CREAT);
if (result != 0) { if (result != 0) {

View File

@@ -4,6 +4,7 @@
#include <quadflashlib.h> #include <quadflashlib.h>
#include <xcore/chanend.h> #include <xcore/chanend.h>
#include <xcore/channel.h> #include <xcore/channel.h>
#include "uac_hwresources.h"
#include "hmac.h" #include "hmac.h"
#include "xua_conf.h" #include "xua_conf.h"
#include "swlock.h" #include "swlock.h"
@@ -87,7 +88,7 @@ fl_QSPIPorts p_opt_tile0 =
XS1_PORT_1B, XS1_PORT_1B,
XS1_PORT_1C, XS1_PORT_1C,
XS1_PORT_4B, XS1_PORT_4B,
XS1_CLKBLK_3 CLKBLK_FLASHLIB
}; };
fl_QSPIPorts p_opt_tile1 = fl_QSPIPorts p_opt_tile1 =
@@ -95,7 +96,7 @@ fl_QSPIPorts p_opt_tile1 =
XS1_PORT_1F, XS1_PORT_1F,
XS1_PORT_1G, XS1_PORT_1G,
XS1_PORT_4D, XS1_PORT_4D,
XS1_CLKBLK_3 CLKBLK_FLASHLIB
}; };
#define KEY_ADDRESS 0xFFFD0 #define KEY_ADDRESS 0xFFFD0