This commit is contained in:
Silent YANG 2024-07-10 20:17:18 +08:00
parent b0df237cbc
commit ca3a01ef2e

View file

@ -78,6 +78,7 @@
calendar: [], calendar: [],
rom: [], rom: [],
bl: undefined, bl: undefined,
blName: '',
nowDrag: -1, nowDrag: -1,
showAdd: '', showAdd: '',
status: '' status: ''
@ -125,7 +126,9 @@
}) })
const loadBL = async() => { const loadBL = async() => {
const fontPacket = await fetch('/L_BL001.bin') const latestVersion = JSON.parse(await (await fetch('https://k5.vicicode.com/diyapi/bl.json')).text())!.latest;
state.blName = latestVersion;
const fontPacket = await fetch('https://k5.vicicode.com/diyapi/' + latestVersion);
if(fontPacket.body){ if(fontPacket.body){
const reader = fontPacket.body.getReader(); const reader = fontPacket.body.getReader();
const chunks = []; const chunks = [];
@ -174,7 +177,7 @@
await writeRange(0x40000, new Uint8Array([firmware.length]), '固件数量'); await writeRange(0x40000, new Uint8Array([firmware.length]), '固件数量');
const _name_bl_array = new Uint8Array(8); const _name_bl_array = new Uint8Array(8);
_name_bl_array.set(stringToUint8Array("L_BL001")) _name_bl_array.set(stringToUint8Array(state.blName.split('.')[0]))
await writeRange(0X40008, _name_bl_array, '引导程序版本') await writeRange(0X40008, _name_bl_array, '引导程序版本')
const writeMeta: any = []; const writeMeta: any = [];
@ -194,6 +197,7 @@
} }
await eeprom_reboot(appStore.connectPort); await eeprom_reboot(appStore.connectPort);
state.status = state.status + "写入完成<br/>";
setLoading(false); setLoading(false);
} }