mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-21 05:37:54 -06:00
build: Avoid linker magic in compile_time_request.c unique id generation
Avoid generating unique ids via memory locations and linker scripts.
Instead, generate them using code produced by buildcommands.py.
Utilize gcc's ability to perform static string comparisons at compile
time to produce a unique id for each unique string.
This fixes a build failure on ARM introduced in 142b92b8
. It also
reduces the complexity of the build.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
f91a49c65d
commit
b9940f0e0d
6 changed files with 120 additions and 73 deletions
|
@ -112,7 +112,7 @@ static uint8_t in_sendf;
|
|||
|
||||
// Encode a message and transmit it
|
||||
void
|
||||
_sendf(uint8_t parserid, ...)
|
||||
_sendf(const struct command_encoder *ce, ...)
|
||||
{
|
||||
if (readb(&in_sendf))
|
||||
// This sendf call was made from an irq handler while the main
|
||||
|
@ -120,8 +120,7 @@ _sendf(uint8_t parserid, ...)
|
|||
return;
|
||||
writeb(&in_sendf, 1);
|
||||
|
||||
const struct command_encoder *cp = &command_encoders[parserid];
|
||||
uint8_t max_size = READP(cp->max_size);
|
||||
uint8_t max_size = READP(ce->max_size);
|
||||
char *buf = console_get_output(max_size + MESSAGE_MIN);
|
||||
if (!buf)
|
||||
goto done;
|
||||
|
@ -129,10 +128,10 @@ _sendf(uint8_t parserid, ...)
|
|||
if (max_size) {
|
||||
char *maxend = &p[max_size];
|
||||
va_list args;
|
||||
va_start(args, parserid);
|
||||
uint8_t num_params = READP(cp->num_params);
|
||||
const uint8_t *param_types = READP(cp->param_types);
|
||||
*p++ = READP(cp->msg_id);
|
||||
va_start(args, ce);
|
||||
uint8_t num_params = READP(ce->num_params);
|
||||
const uint8_t *param_types = READP(ce->param_types);
|
||||
*p++ = READP(ce->msg_id);
|
||||
while (num_params--) {
|
||||
if (p > maxend)
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue