mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-10-19 01:59:55 -05:00
19ca09d6ee8656064b4971d2d22810e9ea20b2cc
gpio_adc_setup() enabled and calibrated an adc block every time one of its channels was configured. The n32g455 puts PA0 and PA1 on the same block, so configuring the second pin recalibrated an adc that was already running: from then on that block could no longer complete a conversion for the newly added channel, and the mcu spent its time polling an adc that never signalled completion. On a FlashForge AD5M toolhead this left the hotend thermistor reading 0C while the mcu busy time reported in the periodic stats grew by more than a factor of two. Enable the clock of the block that is actually needed rather than all four, and use that clock enable bit to tell whether the block still needs to be initialised, the way stm32/adc.c uses is_enabled_pclock(). Signed-off-by: Lev Voronov <minicx@disroot.org>
Welcome to the Klipper project!
The Klipper firmware controls 3d-Printers. It combines the power of a general purpose computer with one or more micro-controllers. See the features document for more information on why you should use the Klipper software.
Start by installing Klipper software.
Klipper software is Free Software. See the license or read the documentation. We depend on the generous support from our sponsors.
Languages
C
94.9%
Python
3.2%
Jupyter Notebook
1.5%
C++
0.2%
