When delaying response registration, don't warn about any of these
messages that arrive prior to the aactual response registration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename mcu.register_response() to mcu.register_serial_response and
validate the message response format.
Only register the callbacks after the mcu has been initialized. This
avoids invoking callbacks with data from a previous sessions, which
could lead to internal errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the get_last_value() method to return time first then value
(instead of value, then time). This makes get_last_value() match the
order of parameters that is used in the adc update callback.
This also fixes ads1x1x to return the "print_time" instead of a system
time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Previously a querycmd.send() request would silently hang if the code
is run in "file output" mode (that is, it is not communicating with a
real micro-controller). This behavior makes it hard to implement
regression tests and is generally confusing.
Change the code to respond with a dummy response (typically all zeros
and empty strings) instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
For correct operation the trsync system must be programmed prior to
the start of endstop checking. This means the desired "reqclock" for
the trsync configuration messages need to use the same "clock" that
the endstop start message uses - even though the actual deadline for
these messages is later.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Arriving of SW PWM out of sync
can cause pulse width distortion - make them longer
Synchronize the update clock to avoid that
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This adds a dedicated check for that case to be able to
find the root cause of a misconfiguration earlier.
Also, replace occurrences of hardcoded max tick count.
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
Determine which mcu raised the shutdown from the shutdown details
report. Also, pass shutdown_clock via that details report.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allocate the low-level C stepcompress object in the motion_queuing
module. This simplifies the mcu.py code as it no longer needs to
track the stepqueues for the steppersync object.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a function that returns the minimum amount of time the host needs
to reserve for messages to be sent from host to micro-controller.
Add a function that returns the maximum amount of time (in seconds)
that all micro-controllers should be able to schedule future timers
at.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for a new get_canbus_status command to canserial.c .
Add new canbus_stats.py module that will periodically query canbus
mcus for connection status information.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename this method so that it is more distinct from the the common
temperature setup_minmax() method.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Create a new module to help format verbose mcu error messages. Move
the shutdown message formatting to this module. This moves the error
formatting out of the background thread and out of the critical
shutdown code path.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the msgproto.py code so that it can support message ids that
are larger than a single byte. (The host C code in
klippy/chelper/msgblock.c already supports multi-byte ids.)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Raise a printer.command_error exception if a home_wait() call fails.
This makes it easier to support future types of homing errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new runtime_warning() method that will add a 'runtime_warning'
type message to the printer.configfile.warnings object.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>