feat(t-deck): Add audio output and sdcard support#417
Merged
Conversation
* Update `espp::TDeck` to support audio output with same API as `espp::EspBox` for interoperability * Update t-deck example to demonstrate audio the same way that the esp-box example does Improves the utility and functionality of the device to better support the T-Deck. This is also part of the work to allow the esp-box-emu project to run on the TDeck. Build and run `t-deck/example` on a TDeck and ensure it works and the sound plays correctly.
|
✅Static analysis result - no issues found! ✅ |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds audio output and SD card support to the TDeck platform while updating related documentation and example code.
- Adds SPI bus initialization for shared LCD, SD card, and audio support.
- Implements I2S-based audio playback and SD card mounting functionality.
- Updates the t-deck example to demonstrate audio controls alongside existing features.
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| components/t-deck/src/t-deck.cpp | Adds SPI bus initialization and configures CS pins for peripherals. |
| components/t-deck/src/sdcard.cpp | Implements SD card initialization with FAT filesystem mounting. |
| components/t-deck/src/buttons.cpp | Introduces boot button initialization with interrupt support. |
| components/t-deck/src/audio.cpp | Adds I2S audio support, audio task callback, and playback functions. |
| components/t-deck/include/t-deck.hpp | Updates header to expose new audio and SD card APIs. |
| components/t-deck/example/main/t_deck_example.cpp | Updates example to load and play audio, and demonstrate volume/mute control. |
| components/esp-box/include/esp-box.hpp | Minor update to alias definitions for consistency. |
Files not reviewed (2)
- components/t-deck/CMakeLists.txt: Language not supported
- components/t-deck/example/main/CMakeLists.txt: Language not supported
Comments suppressed due to low confidence (1)
components/t-deck/src/audio.cpp:170
- The flag 'has_sound' is set to true after queuing audio but is never reset, which may cause subsequent calls to block indefinitely. Consider resetting this flag once the audio task completes processing.
play_audio_task_handle_ = xTaskGetCurrentTaskHandle();
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
espp::TDeckto support audio output with same API asespp::EspBoxfor interoperabilityespp::TDeckto support sdcard configurationMotivation and Context
Improves the utility and functionality of the device to better support the T-Deck. This is also part of the work to allow the esp-box-emu project to run on the TDeck.
How has this been tested?
Build and run
t-deck/exampleon a TDeck and ensure it works and the sound plays correctly.Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
Checklist:
Software
.github/workflows/build.ymlfile to add my new test to the automated cloud build github action.