Skip to content

Commit

Permalink
fix: send correct file extension for firmware
Browse files Browse the repository at this point in the history
up to now, we called the firmware file simply `firmware`, without any extension. However, Wokwi needs the extension to detect the format of the firmware (elf / hex / uf2 / bin).
  • Loading branch information
urish committed May 28, 2023
1 parent e0fe1a1 commit bfc9da6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ async function main() {
};
await client.connected;
await client.fileUpload('diagram.json', diagram);
await client.fileUpload('firmware', readFileSync(firmwarePath));
const extension = firmwarePath.split('.').pop();
const firmwareName = `firmware.${extension}`;
await client.fileUpload(firmwareName, readFileSync(firmwarePath));
await client.fileUpload('firmware.elf', readFileSync(elfPath));

if (!quiet) {
Expand Down Expand Up @@ -151,7 +153,7 @@ async function main() {
const { timeToNextEvent } = eventManager;
await client.simStart({
elf: 'test.elf',
firmware: 'firmware',
firmware: firmwareName,
pause: timeToNextEvent >= 0,
});
if (timeToNextEvent > 0) {
Expand Down

0 comments on commit bfc9da6

Please sign in to comment.