aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/buildcommands.py
Commit message (Collapse)AuthorAgeFilesLines
* buildcommands: Convert to Python3 string encodingKevin O'Connor2021-10-011-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Don't attach hostname and build date to version on a clean buildKevin O'Connor2021-04-221-6/+10
| | | | | | | Most builds will be direclty from git - removing the hostname and build date should permit reproducible binaries in that common case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Call irq_poll() after last task functionKevin O'Connor2021-04-211-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Extend number of available mcu messages from 96 to 128Kevin O'Connor2021-02-181-12/+15
| | | | | | | | | | | Some internal code treats the message ids as encoded "variable length quantities", while other internal code assumes the message id is always one byte long. Continue using this scheme, but convert the VLQ users to use the name "msgtag" while the 1-byte users use "msgid". Increase the number of available msgids from 96 to 127 - the higher values get encoded as negative "msgtags". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Avoid peeking into the msgproto class membersKevin O'Connor2021-02-181-18/+17
| | | | | | | Update callers to only use exported methods of the msgproto objects. This makes it easier to make internal changes to the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Match DECL_X names to the actual C macro namesKevin O'Connor2019-08-221-5/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ctr: Encode negative integers in normal hex notationKevin O'Connor2019-08-221-14/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Allow count parameter of DECL_ENUMERATION_RANGE() to be an expressionKevin O'Connor2019-08-221-6/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ctr: Encode integers in hexKevin O'Connor2019-08-221-2/+2
| | | | | | | Replace the custom encoding with a hex encoding. This makes it a little easier to inspect the CTR conversions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Translate null characters to newline characters in ctr requestsKevin O'Connor2019-08-221-1/+1
| | | | | | | | Store the CTR requests in compile_time_request.txt with the null characters removed. This makes it slightly easier to inspect the CTR conversions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Add generic code for early board init on armcm machinesKevin O'Connor2019-08-221-0/+44
| | | | | | | | Add basic ARM Cortex-M C init code and build linker scripts to src/generic/ code. This can be used to simplify the various ARM board code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* initial_pins: Add ability to configure output pins at mcu startupKevin O'Connor2019-03-171-3/+53
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Convert static strings to a more generic enumeration systemKevin O'Connor2019-03-171-9/+29
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Support evaluating C expressions in DECL_CONSTANT()Kevin O'Connor2019-03-171-4/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Use dictionaries to describe commands, responses, and outputKevin O'Connor2019-03-171-12/+16
| | | | | | | Avoid transmitting lists of message ids for commands and responses - gzip doesn't do a good job of compressing them. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Wrap code to 80 columnsKevin O'Connor2019-02-271-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Make sure to not use 96 or more message idsKevin O'Connor2018-11-181-0/+3
| | | | | | The mcu code assumes the encoder and parser id is always one byte. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Remove unnecessary spaces from data dictionaryKevin O'Connor2018-11-181-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Detect duplicate strings when generating static string idsKevin O'Connor2018-11-181-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Move data dictionary generation to its own classKevin O'Connor2018-11-181-39/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Move version generation to its own classKevin O'Connor2018-11-181-18/+27
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Move command/response code generation to its own classKevin O'Connor2018-11-181-142/+155
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Move DECL_CONSTANT code to its own classKevin O'Connor2018-11-181-13/+27
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Move DECL_STATIC_STR code to its own classKevin O'Connor2018-11-181-28/+41
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Move DECL_CALLLIST code to its own classKevin O'Connor2018-11-181-26/+42
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Use git describe --alwaysKevin O'Connor2018-02-261-1/+1
| | | | | | | | Add --always flag to "git describe" command to get a build identifier even if one checks out the repo with a depth parameter that prunes out the last tagged version. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Add gcc and binutils version to mcu data dictionaryKevin O'Connor2017-12-211-6/+43
| | | | | | | | Store the gcc and binutils versions used in the compilation of the firmware in the firmware data dictionary. Forward that information to the log so it is available during debugging. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Pass shutdown reason code via longjmp() parameterKevin O'Connor2017-07-041-2/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Export static_strings from mcu to host as a dictionaryKevin O'Connor2017-07-021-1/+2
| | | | | | Export the static strings as a dictionary instead of as a list. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Directly call command_sendf() for ack/nak messagesKevin O'Connor2017-06-291-9/+1
| | | | | | | Don't use the sendf() macro for ack and nak messages - directly call the command_sendf() code instead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Encode MESSAGE_MIN in command_parser->max_sizeKevin O'Connor2017-06-291-3/+5
| | | | | | | Add the message minimum into the stored constant so it does not need to be added at run-time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Request python2 for all directly executed python binariesKevin O'Connor2017-06-271-1/+1
| | | | | | | Some systems point python to python3 instead of python2 - explicitly request python2 to avoid conflicts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Store the command parsing information directly in arrayKevin O'Connor2017-05-261-12/+6
| | | | | | | Instead of defining an array of pointers, just define the array directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Use compile_time_request system for init, tasks, and shutdownKevin O'Connor2017-05-261-2/+26
| | | | | | | | Avoid using linker magic to define the init, task, and shutdown functions. Instead, use the compile_time_request system. This simplifies the build and produces more efficient code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Avoid linker magic in compile_time_request.c unique id generationKevin O'Connor2017-05-261-19/+65
| | | | | | | | | | | | 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>
* build: Add __visible to variables in compile_time_request.cKevin O'Connor2017-05-151-6/+8
| | | | | | | Add __visible to generated code in compile_time_request.c so that the main code can be compiled with -fwhole-program. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Define DECL_CONSTANT mechanism for defining exported constantsKevin O'Connor2016-12-231-28/+15
| | | | | | | | | Add a DECL_CONSTANT macro to allow the firmware to define constants that are to be exported to the host during the "identify" phase. This replaces the existing hardcoded mechanism of scanning the Kconfig header file for certain constants. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Support creating and storing the data dictionary on each buildKevin O'Connor2016-09-101-3/+11
| | | | | | | Generate the data dictionary in out/klipper.dict on each build. This makes it easier to use the dictionary when debugging. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Calculate baudadjust from MCU's baud instead of host baudKevin O'Connor2016-07-161-1/+1
| | | | | | | Store the baud rate the MCU is configured for in the "identify" data and use that rate when calculating the baudadjust parameter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Fix max_size calculationKevin O'Connor2016-06-051-1/+1
| | | | | | | The maximum max_size value should not include MESSAGE_MIN - that is already added by the runtime code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+313
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>