mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-18 20:28:10 -06:00
configfile: Add support for reporting runtime_warnings via the API server
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>
This commit is contained in:
parent
d99d1a8463
commit
0291a1554c
2 changed files with 14 additions and 4 deletions
|
@ -811,8 +811,10 @@ class MCU:
|
|||
mcu_freq_mhz = int(mcu_freq / 1000000. + 0.5)
|
||||
calc_freq_mhz = int(calc_freq / 1000000. + 0.5)
|
||||
if mcu_freq_mhz != calc_freq_mhz:
|
||||
logging.warn("MCU '%s' configured for %dMhz but running at %dMhz!",
|
||||
self._name, mcu_freq_mhz, calc_freq_mhz)
|
||||
pconfig = self._printer.lookup_object('configfile')
|
||||
msg = ("MCU '%s' configured for %dMhz but running at %dMhz!"
|
||||
% (self._name, mcu_freq_mhz, calc_freq_mhz))
|
||||
pconfig.runtime_warning(msg)
|
||||
# Config creation helpers
|
||||
def setup_pin(self, pin_type, pin_params):
|
||||
pcs = {'endstop': MCU_endstop,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue