Compare commits

..

No commits in common. "f7fbcfefefbf48f891fd88a625d330978208b7ff" and "c56e4e560884947903694de17a2300e3e589ee91" have entirely different histories.

2 changed files with 12 additions and 19 deletions

View file

@ -78,7 +78,6 @@
calendar: [],
rom: [],
bl: undefined,
blName: '',
nowDrag: -1,
showAdd: '',
status: ''
@ -126,9 +125,7 @@
})
const loadBL = async() => {
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);
const fontPacket = await fetch('/L_BL001.bin')
if(fontPacket.body){
const reader = fontPacket.body.getReader();
const chunks = [];
@ -177,7 +174,7 @@
await writeRange(0x40000, new Uint8Array([firmware.length]), '固件数量');
const _name_bl_array = new Uint8Array(8);
_name_bl_array.set(stringToUint8Array(state.blName.split('.')[0]))
_name_bl_array.set(stringToUint8Array("L_BL001"))
await writeRange(0X40008, _name_bl_array, '引导程序版本')
const writeMeta: any = [];
@ -185,7 +182,7 @@
const _meta_name = new Uint8Array(16)
const _meta_address_start = new Uint8Array(4)
const _meta_address_end = new Uint8Array(4)
_meta_name.set(stringToUint8Array(item.binaryName.replace(/[^\x00-\xff]/g, '')))
_meta_name.set(stringToUint8Array(item.binaryName))
_meta_address_start.set(hexReverseStringToUint8Array((item.start).toString(16)));
_meta_address_end.set(hexReverseStringToUint8Array((item.end).toString(16)));
writeMeta.push(..._meta_name, ..._meta_address_start, ..._meta_address_end, ...new Uint8Array(8))
@ -197,27 +194,23 @@
}
await eeprom_reboot(appStore.connectPort);
state.status = state.status + "写入完成<br/>";
setLoading(false);
}
const selectFile = () => {
const input = document.createElement('input');
input.type = 'file';
input.multiple = true;
input.onchange = async () => {
if(input.files){
for(let i = 0; i < input.files.length; i++){
const blob = new Blob([input.files[i]], { type: 'application/octet-stream' });
const blob = new Blob([input.files[0]], { type: 'application/octet-stream' });
const rawEEPROM = new Uint8Array(await blob.arrayBuffer());
const firmware = {
binaryFile: unpack(rawEEPROM),
binaryName: input.files[i].name.replace(/[^\x00-\xff]/g, ''),
binaryName: input.files[0].name,
color: getColor()
}
state.rom.push(firmware)
}
}
};
input.click();
}
@ -296,7 +289,7 @@
}
const changeName = (val: any) => {
state.rom[val].binaryName = state.rom[val].binaryName.replace(/[^\x00-\xff]/g, '')
state.rom[val].binaryName = state.rom[val].binaryName.replace(/[^\a-\z\A-\Z0-9.]/g, '')
};
</script>

View file

@ -14,7 +14,7 @@
<div>
<a-radio-group type="button" size="mini" v-model="state.protocol">
<a-radio value="Official">Official</a-radio>
<!-- <a-radio value="Losehu">Losehu</a-radio> -->
<a-radio value="Losehu">Losehu</a-radio>
</a-radio-group>
</div>
</div>