Thanks. That seems to be pretty much what I was doing at one time -Example:
const uint8_t * flash_patch = (uint8_t *) 0x1003FF1C;
which_hardware = * flash_patch;
Both are variants of the Binary Info editing scheme.unsigned char __attribute__ ((aligned (256))) LED_INFORMATION[] = {
/* led_use = */ "\x00" /* led_pin = */ "\xF1"
/* cyw_use = */ "\x00" /* cyw_pin = */ "\xF2"
/* pix_num = */ "\x00" /* pix_pin = */ "\xF3"
"<-- Inserted LED_INFORMATION ---------------------------------------->"
};
#define led_use ((uint8_t) LED_INFORMATION[0])
#define led_pin ((uint8_t) LED_INFORMATION[1])
#define cyw_use ((uint8_t) LED_INFORMATION[2])
#define cyw_pin ((uint8_t) LED_INFORMATION[3])
#define pix_num ((uint8_t) LED_INFORMATION[4])
#define pix_pin ((uint8_t) LED_INFORMATION[5])
#define brd_nam ((char *) &LED_INFORMATION[6])
Post-build configuration is useful, is great for example code, but it doesn't scale. As soon as your program brings in any SDK function which has a '#if' conditional based on board definition you are busted, can only build for a limited range of boards from what has been built.
You need those SDK functions to not use '''#if', but use the post-build poked values instead.
Statistics: Posted by hippy — Thu Aug 07, 2025 11:07 pm