Skip to content

Commit

Permalink
abstract MIN_FIRMWARE size
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter93 committed Jan 6, 2025
1 parent 4ccc5bf commit 84db9c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sonixflasher.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define USER_ROM_PAGES_SN32F290 256

#define QMK_OFFSET_DEFAULT 0x200
#define MIN_FIRMWARE 0x100

#define CMD_BASE 0x55AA
#define CMD_GET_FW_VERSION 0x1
Expand Down Expand Up @@ -730,7 +731,7 @@ bool sanity_check_firmware(long fw_size, long offset) {
fprintf(stderr, "ERROR: Firmware is too large too flash: 0x%08lx max allowed is 0x%08lx.\n", fw_size, MAX_FIRMWARE - offset);
return false;
}
if (fw_size < 0x100) {
if (fw_size < MIN_FIRMWARE) {
fprintf(stderr, "ERROR: Firmware is too small.");
return false;
}
Expand Down

0 comments on commit 84db9c9

Please sign in to comment.