Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ static constexpr bool bsp_supports_touchscreen = false;
static void set_audio_output_volume(float volume_percent) {
auto clamped_volume_percent = std::clamp(volume_percent, 0.0f, 100.0f);
desired_audio_volume_percent = clamped_volume_percent;
if constexpr (bsp_supports_pcm_audio_output) {
hal::get().volume(clamped_volume_percent);
}
#if CONFIG_HARDWARE_BOX || CONFIG_HARDWARE_TDECK
hal::get().volume(clamped_volume_percent);
#endif
}

static float get_audio_volume_for_touch_x(uint16_t touch_x) {
Expand Down Expand Up @@ -192,6 +192,7 @@ extern "C" void app_main(void) {
logger.info("Clearing screen");
clear_screen();

#if CONFIG_HARDWARE_BOX || CONFIG_HARDWARE_TDECK
if constexpr (bsp_supports_touchscreen && bsp_supports_pcm_audio_output) {
auto touch_callback = [](const auto &touch) {
auto &hw = hal::get();
Expand All @@ -205,6 +206,7 @@ extern "C" void app_main(void) {
logger.warn("Could not initialize touch input for audio volume control");
}
}
#endif

// create the parsing and display task
logger.info("Starting display task");
Expand Down
Loading