add new boards

This commit is contained in:
Terrence
2024-11-01 14:26:02 +08:00
parent a701d5918e
commit b0bc81b921
24 changed files with 451 additions and 146 deletions

View File

@@ -72,10 +72,11 @@ public:
return new BoxAudioDevice();
}
virtual bool GetBatteryVoltage(int &voltage) override {
virtual bool GetBatteryVoltage(int &voltage, bool& charging) override {
int adc_reading;
ESP_ERROR_CHECK(adc_oneshot_read(adc1_handle_, ADC_CHANNEL_0, &adc_reading));
ESP_ERROR_CHECK(adc_cali_raw_to_voltage(adc1_cali_handle_, adc_reading, &voltage));
charging = false;
return true;
}
};