-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use incomplete clock sync for SPI temperature; always warn #303
Don't use incomplete clock sync for SPI temperature; always warn #303
Conversation
looks great! Thanks :) |
In case someone is interested in improving this, there is one other thing that regularly tries to call
I'm not sure what the source is of this; seems to be webhook related. I did have mainsail open in my browser. |
This is called when the API is requesting status to show in the frontend, in this case it's the print time returned for the toolhead object. Best regards, |
As regards to the issue, can you try moving this line in spi_temperature to a connect handler?
An alternative could be to add a ClockSync gets initialized during the I actually think the two warnings you put in ClockSync should be extended to dump the callstack because anything calling them before the connect event has passed should be considered a bug. Thoughts @rogerlz ? Maybe we could add a Best regards, |
Thank you for your input! This is the kind of architectural knowledge I was missing. I'll make some changes some time in the next few days. |
94891f5
to
1fd4b13
Compare
I changed the check to checking the frequency value in |
1fd4b13
to
f39fd7d
Compare
@bwnance Are you waiting for something from me, or are you just busy? I think it's ready for review. |
Hi, Did the connected handler fix stop the issue as intended? If so, I think this is good to merge. Best regards, |
print stacktrace if clock is used before frequency is set
f39fd7d
to
da0fbfd
Compare
Yes, as far as I can tell, it's working perfectly. |
Thank you! |
The problem is outlined in Klipper3d/klipper#6619
In this PR, I have done two things:
clock_to_print_time()
andprint_time_to_clock()
There may be a better solution to this; I'm not sure. I headed down the path of making
clock_to_print_time()
andprint_time_to_clock()
raise an exception, but there's just too much stuff that happily accepts the wrong value for my little non-python-fluent brain to handle it all.