Commit Graph

39 Commits

Author SHA1 Message Date
Kevin O'Connor 8714282570 console: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:22:13 -04:00
Kevin O'Connor babde17c4c console: Add support for connecting via CAN bus
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-13 11:29:41 -05:00
Kevin O'Connor 5f80c84309 console: Add option to enable debug output mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-02 11:38:50 -05:00
Kevin O'Connor 3c6eb376ac console: Make baud an optional parameter
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>
2021-03-02 11:38:50 -05:00
Kevin O'Connor 9d3a3f3f30 serialhdl: Update callers to decide serial fd type
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>
2021-03-02 11:38:50 -05:00
Kevin O'Connor 81da5379d4 buildcommands: Extend number of available mcu messages from 96 to 128
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>
2021-02-18 15:21:32 -05:00
Kevin O'Connor efa497dfd8 msgproto: Avoid peeking into the msgproto class members
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>
2021-02-18 14:33:44 -05:00
Kevin O'Connor a67451fa36 console: Update for PinResolver changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-19 23:52:02 -04:00
Kevin O'Connor 395429be14 pins: Move reserved pin handling into PinResolver class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-19 12:57:59 -04:00
Kevin O'Connor 461ed4cb80 serialhdl: Add a get_msgparser() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 18:14:00 -04:00
Kevin O'Connor 647f1ee2e0 serialhdl: Rename register_callback() to register_response()
Rename the method and use that name in the mcu class as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 18:14:00 -04:00
Kevin O'Connor 1ab02e5225 bus: Support bus enumerations and add support for reserved pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:29:31 -04:00
Kevin O'Connor e5e079faf2 console: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:00:30 -05:00
Kevin O'Connor ac72f8ec78 console: Try to improve the description of the SUPPRESS command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 17:16:14 -05:00
Kevin O'Connor ab4060e145 console: Use reactor register_callback() mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:31:36 -04:00
Kevin O'Connor 4bf1b042b1 console: Report timestamp on each read message
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-21 12:01:26 -04:00
Kevin O'Connor 2e3fa8da13 console: Fix handling of bad commands
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>
2018-05-08 11:31:25 -04:00
Kevin O'Connor bb8926d67a klippy: Automatically clear rollover_info on each restart
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>
2018-04-03 13:18:52 -04:00
Kevin O'Connor b139a8561f serialhdl: Add a wrapper around the results of lookup_command()
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>
2018-02-27 21:06:16 -05:00
Kevin O'Connor 3833669c3a pins: Check if the same pin is referenced via different aliases
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>
2018-01-10 19:26:06 -05:00
Kevin O'Connor 13812aa1c9 clocksync: Move clock synchronization code into new file
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>
2017-09-19 17:25:42 -04:00
Kevin O'Connor 52156d2c41 pins: Don't pass mcu_freq to update_command()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-09-13 09:16:58 -04:00
Kevin O'Connor 477b3941a6 console: Add support for SUPPRESS command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-09-07 11:19:27 -04:00
Kevin O'Connor 36dd7e7609 console: Add support for a FLOOD command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-09-07 11:19:27 -04:00
Kevin O'Connor 5e6acf7dbc console: Add support for a STATS command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-08-08 00:27:28 -04:00
Kevin O'Connor 58811b5c44 console: Add LIST command that shows available commands and variables
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-08-08 00:27:28 -04:00
Kevin O'Connor 86a762b2b7 console: Add a HELP command
Show available features at startup.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-08-08 00:27:28 -04:00
Kevin O'Connor d2fafbdd9e build: Request python2 for all directly executed python binaries
Some systems point python to python3 instead of python2 - explicitly
request python2 to avoid conflicts.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-06-27 20:26:02 -04:00
Kevin O'Connor e92ce565dd console: Support new artificial DELAY command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-06-22 10:51:49 -04:00
Kevin O'Connor 1bc3e0a678 klippy: Use newer "except XYZError as e" python syntax
Use the newer syntax for python exceptions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-06-10 00:08:06 -04:00
Kevin O'Connor ccb93068fe msgproto: Rework dump() so it also works with params
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>
2017-04-25 13:58:13 -04:00
Kevin O'Connor a6fe355801 console: Automatically convert float values to int during evaluation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-04-25 12:26:13 -04:00
Kevin O'Connor fe11c3e348 console: Use stdout.write() instead of print
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-04-25 12:26:13 -04:00
Kevin O'Connor 1d796a4e24 mcu: Support config mechanism for translating seconds to clock ticks
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>
2017-03-13 00:38:17 -04:00
Kevin O'Connor 8e6d5efdac pins: Simplify pin map alias setup
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>
2017-03-13 00:38:15 -04:00
Kevin O'Connor fe95ea221b build: Define DECL_CONSTANT mechanism for defining exported constants
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>
2016-12-23 17:06:10 -05:00
Kevin O'Connor 535c7b99b4 serialhdl: Make SerialReader.connect() blocking
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>
2016-11-29 21:57:49 -05:00
Kevin O'Connor ff789058df console: Update the debugging console to support setting local varables
Add a "SET varname value" local command to the console.py script.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-06-13 23:18:58 -04:00
Kevin O'Connor f582a36e4d Initial commit of source code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2016-05-25 11:37:40 -04:00