Skip to content

Commit e0256be

Browse files
authored
Merge pull request #9784 from bablokb/rp2350b_temp
use ADC_TEMPERATURE_CHANNEL_NUM instead of hard-coded channel '4'
2 parents cf76704 + d6be48b commit e0256be

File tree

1 file changed

+1
-1
lines changed
  • ports/raspberrypi/common-hal/microcontroller

1 file changed

+1
-1
lines changed

ports/raspberrypi/common-hal/microcontroller/Processor.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
float common_hal_mcu_processor_get_temperature(void) {
4040
adc_init();
4141
adc_set_temp_sensor_enabled(true);
42-
adc_select_input(4);
42+
adc_select_input(ADC_TEMPERATURE_CHANNEL_NUM);
4343
uint16_t value = adc_read();
4444
adc_set_temp_sensor_enabled(false);
4545
float voltage = value * 3.3 / (1 << 12);

0 commit comments

Comments
 (0)