Add logging to the DAC
This commit is contained in:
@@ -124,6 +124,27 @@ void RegisterVolume() {
|
||||
esp_console_cmd_register(&cmd);
|
||||
}
|
||||
|
||||
int CmdAudioStatus(int argc, char** argv) {
|
||||
static const std::string usage = "usage: audio";
|
||||
if (argc != 1) {
|
||||
std::cout << usage << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
sInstance->playback_->LogStatus();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RegisterAudioStatus() {
|
||||
esp_console_cmd_t cmd{.command = "audio",
|
||||
.help = "logs the current status of the audio pipeline",
|
||||
.hint = NULL,
|
||||
.func = &CmdAudioStatus,
|
||||
.argtable = NULL};
|
||||
esp_console_cmd_register(&cmd);
|
||||
}
|
||||
|
||||
AppConsole::AppConsole(audio::AudioPlayback* playback) : playback_(playback) {
|
||||
sInstance = this;
|
||||
}
|
||||
@@ -136,6 +157,7 @@ auto AppConsole::RegisterExtraComponents() -> void {
|
||||
RegisterPlayFile();
|
||||
RegisterToggle();
|
||||
RegisterVolume();
|
||||
RegisterAudioStatus();
|
||||
}
|
||||
|
||||
} // namespace console
|
||||
|
||||
@@ -97,6 +97,7 @@ extern "C" void app_main(void) {
|
||||
|
||||
ESP_LOGI(TAG, "Enable power rails for development");
|
||||
expander->with([&](auto& gpio) {
|
||||
gpio.set_pin(drivers::GpioExpander::AUDIO_POWER_ENABLE, 1);
|
||||
gpio.set_pin(drivers::GpioExpander::USB_INTERFACE_POWER_ENABLE, 0);
|
||||
gpio.set_pin(drivers::GpioExpander::SD_CARD_POWER_ENABLE, 1);
|
||||
gpio.set_pin(drivers::GpioExpander::SD_MUX_SWITCH,
|
||||
|
||||
Reference in New Issue
Block a user