fix(t1000e): reclassify P0.04 as sensor power enable GPIO (#9826)
P0.04 is a digital power-enable pin for the NTC/LUX sensors, not an ADC input. The old code was calling analogRead() on a floating GPIO that happened to read ~mid-rail, coincidentally producing reasonable temperature values. - Rename T1000X_VCC_PIN to T1000X_SENSOR_EN_PIN and drive it HIGH in initVariant() for both T1000-E and T1000-S variants - Read BATTERY_PIN (with ADC_MULTIPLIER) instead, clamped to the 3.0V LDO output (NTC_REF_VCC) for the NTC resistance calculation
This commit is contained in:
@@ -38,6 +38,9 @@ void initVariant()
|
||||
pinMode(PIN_3V3_ACC_EN, OUTPUT);
|
||||
digitalWrite(PIN_3V3_ACC_EN, HIGH);
|
||||
|
||||
pinMode(T1000X_SENSOR_EN_PIN, OUTPUT);
|
||||
digitalWrite(T1000X_SENSOR_EN_PIN, HIGH);
|
||||
|
||||
pinMode(BUZZER_EN_PIN, OUTPUT);
|
||||
digitalWrite(BUZZER_EN_PIN, HIGH);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user