1
0
Fork 0
mirror of https://github.com/silenty4ng/k5web synced 2025-04-13 14:30:33 +00:00
This commit is contained in:
Silent YANG 2024-07-01 22:30:38 +08:00
parent dbb1c3aeb3
commit c6f95f4725

View file

@ -95,6 +95,12 @@ const flashIt = async () => {
const _data = new Uint8Array([0x30, 0x5, rawVersion.length, 0x0, ...rawVersion]);
await sendPacket(_connect, _data);
await readPacket(_connect, 0x18)
if(state.protocol == 'Official'){
await sendPacket(_connect, _data);
await readPacket(_connect, 0x18);
}
const firmware = unpack(state.binaryFile);
if (firmware.length > 0xefff) throw new Error('Last resort boundary check failed. Whoever touched the code is an idiot.');