aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/console.py
Commit message (Collapse)AuthorAgeFilesLines
* console: No need to import pins moduleKevin O'Connor2023-01-071-7/+2
| | | | | | The pins module is no longer used in console.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add support for DUMP and FILEDUMP commandsKevin O'Connor2022-07-291-1/+52
| | | | | | Add helper functions to dump memory via debug_read commands. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Remove support for PINS commandKevin O'Connor2021-11-021-4/+1
| | | | | | Remove support for builtin pin aliases from the console.py tool. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Use regular str() types for commands on Python2Kevin O'Connor2021-10-311-1/+1
| | | | | | | Avoid using unicode() types on Python2 as it can lead to subtle errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Fix Python2 compatibilityKevin O'Connor2021-10-081-1/+1
| | | | | | Make sure to import util prior to reactor. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Convert to Python3 string encodingKevin O'Connor2021-10-011-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add support for connecting via CAN busKevin O'Connor2021-03-131-3/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add option to enable debug output modeKevin O'Connor2021-03-021-1/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Make baud an optional parameterKevin O'Connor2021-03-021-3/+10
| | | | | | | Make the baud rate an optional parameter to the console.py tool. When not present, it will default to 250000. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Update callers to decide serial fd typeKevin O'Connor2021-03-021-5/+9
| | | | | | | | Don't try to detect a "real serial port" in serialhdl.py. Instead, have the callers invoke either connect_uart(), connect_file(), or connect_pipe(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Extend number of available mcu messages from 96 to 128Kevin O'Connor2021-02-181-1/+1
| | | | | | | | | | | 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-7/+9
| | | | | | | 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>
* console: Update for PinResolver changesKevin O'Connor2019-08-191-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Move reserved pin handling into PinResolver classKevin O'Connor2019-08-191-10/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Add a get_msgparser() methodKevin O'Connor2019-06-211-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Rename register_callback() to register_response()Kevin O'Connor2019-06-211-2/+2
| | | | | | Rename the method and use that name in the mcu class as well. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bus: Support bus enumerations and add support for reserved pinsKevin O'Connor2019-04-041-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Wrap code to 80 columnsKevin O'Connor2019-02-271-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Try to improve the description of the SUPPRESS commandKevin O'Connor2018-11-161-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Use reactor register_callback() mechanismKevin O'Connor2018-09-021-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Report timestamp on each read messageKevin O'Connor2018-05-211-1/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Fix handling of bad commandsKevin O'Connor2018-05-081-1/+0
| | | | | | | Don't return early on a command error - continue to process remaining commands and pop commands from the queue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Automatically clear rollover_info on each restartKevin O'Connor2018-04-031-2/+8
| | | | | | | Automatically clear the information printed at the start of each log file rollover on a klippy internal restart. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Add a wrapper around the results of lookup_command()Kevin O'Connor2018-02-271-17/+15
| | | | | | | | Add a lookup_command() method to the SerialReader class that provides a wrapper that stores the serial and commandqueue references. This makes it easier to run the send() method. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Check if the same pin is referenced via different aliasesKevin O'Connor2018-01-101-5/+4
| | | | | | | | Change the update_command() call to use a new PinResolver class. In that new class, verify that the same pin isn't referenced in two different parts of the config using different aliases for the pin. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* clocksync: Move clock synchronization code into new fileKevin O'Connor2017-09-191-5/+8
| | | | | | | Move the low-level clock synchronization code from serialhdl.py to a new file clocksync.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Don't pass mcu_freq to update_command()Kevin O'Connor2017-09-131-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add support for SUPPRESS commandKevin O'Connor2017-09-071-2/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add support for a FLOOD commandKevin O'Connor2017-09-071-2/+23
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add support for a STATS commandKevin O'Connor2017-08-081-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add LIST command that shows available commands and variablesKevin O'Connor2017-08-081-2/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add a HELP commandKevin O'Connor2017-08-081-4/+26
| | | | | | Show available features at startup. 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>
* console: Support new artificial DELAY commandKevin O'Connor2017-06-221-1/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Use newer "except XYZError as e" python syntaxKevin O'Connor2017-06-101-1/+1
| | | | | | Use the newer syntax for python exceptions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Rework dump() so it also works with paramsKevin O'Connor2017-04-251-0/+3
| | | | | | | | | Always call the regular .parse() method for each message type during dump() - add a new .format_params() method for dumping a verbose representation of the parsed message. This allows the new format_params() to also be used with data already parsed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Automatically convert float values to int during evaluationKevin O'Connor2017-04-251-8/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Use stdout.write() instead of printKevin O'Connor2017-04-251-5/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Support config mechanism for translating seconds to clock ticksKevin O'Connor2017-03-131-5/+6
| | | | | | | Introduce a TICKS() macro during config parsing that will translate time in seconds to time in clock ticks. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Simplify pin map alias setupKevin O'Connor2017-03-131-8/+4
| | | | | | | | Use map_pins() to obtain the pin mapping - don't export mcu_to_pins(). The functionality of mcu_to_pins() can be obtained by calling map_pins() with name=None. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Define DECL_CONSTANT mechanism for defining exported constantsKevin O'Connor2016-12-231-1/+1
| | | | | | | | | 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>
* serialhdl: Make SerialReader.connect() blockingKevin O'Connor2016-11-291-2/+6
| | | | | | | Use the greenlet mechanism to wait for the connection to come up in the serial connect() method. This simplifies the calling code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Update the debugging console to support setting local varablesKevin O'Connor2016-06-131-2/+12
| | | | | | Add a "SET varname value" local command to the console.py script. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+102
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>