diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-02-21 09:28:36 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-02-21 09:28:36 +1100 |
| commit | 12d2ffdab70df573610b81d8a24545da33bb67e3 (patch) | |
| tree | eb082a249eab8647c8450dbbd5c320f83b923d6b /src/main/app_console.cpp | |
| parent | 644601b636c28cf82281148a392454cdf9e632f9 (diff) | |
| download | tangara-fw-12d2ffdab70df573610b81d8a24545da33bb67e3.tar.gz | |
Add logging to the DAC
Diffstat (limited to 'src/main/app_console.cpp')
| -rw-r--r-- | src/main/app_console.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/app_console.cpp b/src/main/app_console.cpp index a0ada735..40159f4e 100644 --- a/src/main/app_console.cpp +++ b/src/main/app_console.cpp @@ -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 |
