forked from xiaozhi/xiaozhi-esp32
add new boards
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user