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>
Update static_digital_output.py to directly configure static digital
pins. There are no other users of "static" pins, so remove that
support from mcu.py, replicape.py, and sx1509.py. This simplifies the
low-level pin handling code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The current code has the mcu report a trsync_state message every 10ms
and expects a time extension within 25ms. However, this means that if
a single mcu->host report is lost then 20ms would elapse until the
next report, which would allow for only a 5ms round-trip time before a
timeout error is reported.
Increase the trsync_state timing so that a message is sent every
7.5ms. This increases the total number of messages per second sent
from mcu to host to 133 (from 100). With this change, a single lost
message would still allow for up to a 10ms round-trip time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
When multiple MCUs are involved in homing, stagger the scheduling of
the trsync_state report messages from each mcu. Staggering helps
spread the bandwidth, helps reduce locking contention in the host, and
reduces the chance that intermittent latency could result in a
communication timeout.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>