This commit is contained in:
Serge L 2026-03-03 21:26:47 +02:00 committed by GitHub
commit da4f38a6a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -82,6 +82,7 @@ class PrinterTemperatureMCU:
('stm32l4', self.config_stm32g0),
('stm32h723', self.config_stm32h723),
('stm32h7', self.config_stm32h7),
('gd32f303xe', self.config_gd32f303xe),
('', self.config_unknown)]
for name, func in cfg_funcs:
if self.mcu_type.startswith(name):
@ -166,6 +167,9 @@ class PrinterTemperatureMCU:
cal_adc_110 = self.read16(0x1FF1E840) / 65535.
self.slope = (110. - 30.) / (cal_adc_110 - cal_adc_30)
self.base_temperature = self.calc_base(30., cal_adc_30)
def config_gd32f303xe(self):
self.slope = 3.3 / -.004100
self.base_temperature = self.calc_base(25., 1.45 / 3.3)
def read16(self, addr):
params = self.debug_read_cmd.send([1, addr])
return params['val']