[adc] Fix RP2350B internal temperature reading wrong ADC channel (#18270)

This commit is contained in:
Jesse Hills
2026-08-11 08:22:52 -04:00
committed by GitHub
parent ecec3a19c7
commit e5cdda9ee5
+5 -1
View File
@@ -52,7 +52,11 @@ float ADCSensor::sample() {
if (this->is_temperature_) {
adc_set_temp_sensor_enabled(true);
delay(1);
adc_select_input(4);
// The on-die temperature sensor sits on the last ADC channel, and which one
// that is depends on the chip: input 4 on RP2040 and RP2350A, but input 8 on
// RP2350B, which has eight external channels instead of four. The SDK
// resolves it for the target being built, so do not hardcode it.
adc_select_input(ADC_TEMPERATURE_CHANNEL_NUM);
for (uint8_t sample = 0; sample < this->sample_count_; sample++) {
raw = adc_read();