mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-07 06:57:38 -06:00
sched: Pass shutdown reason code via longjmp() parameter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
cf662b842b
commit
09140a51d5
2 changed files with 9 additions and 7 deletions
|
@ -102,11 +102,13 @@ ctr_lookup_output(const char *str)
|
|||
return fmt % ("".join(encoder_defs).strip(), "".join(encoder_code).strip(),
|
||||
"".join(output_code).strip())
|
||||
|
||||
STATIC_STRING_MIN = 2
|
||||
|
||||
def build_static_strings(static_strings):
|
||||
code = []
|
||||
for i, s in enumerate(static_strings):
|
||||
code.append(' if (__builtin_strcmp(str, "%s") == 0)\n'
|
||||
' return %d;\n' % (s, i))
|
||||
' return %d;\n' % (s, i + STATIC_STRING_MIN))
|
||||
fmt = """
|
||||
uint8_t __always_inline
|
||||
ctr_lookup_static_string(const char *str)
|
||||
|
@ -187,7 +189,7 @@ def build_identify(cmd_by_id, msg_to_id, responses, static_strings
|
|||
data['messages'] = messages
|
||||
data['commands'] = sorted(cmd_by_id.keys())
|
||||
data['responses'] = sorted(responses)
|
||||
data['static_strings'] = { i: static_strings[i]
|
||||
data['static_strings'] = { i + STATIC_STRING_MIN: static_strings[i]
|
||||
for i in range(len(static_strings)) }
|
||||
data['config'] = constants
|
||||
data['version'] = version
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue