Skip to content

Commit

Permalink
use _Static_assert()
Browse files Browse the repository at this point in the history
the Keil compiler with some compiler options doesn't have
static_assert(), and the MRS compiler suite seems to have the same
issue
  • Loading branch information
tridge committed Sep 14, 2024
1 parent a3ff2af commit db741c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ uint16_t low_cell_volt_cutoff = 330; // 3.3volts per cell

//=========================== END EEPROM Defaults ===========================


const char filename[30] __attribute__((section(".file_name"))) = FILE_NAME;
static_assert(sizeof(FIRMWARE_NAME) <=13,"Firmware name too long"); // max 12 character firmware name plus NULL
_Static_assert(sizeof(FIRMWARE_NAME) <= 13,"Firmware name too long"); // max 12 character firmware name plus NULL

uint8_t EEPROM_VERSION;
// move these to targets folder or peripherals for each mcu
Expand Down

0 comments on commit db741c0

Please sign in to comment.