diff options
| author | HiFiPHile <[email protected]> | 2026-08-25 09:27:35 +0200 |
|---|---|---|
| committer | HiFiPHile <[email protected]> | 2026-08-25 09:27:35 +0200 |
| commit | 3db8be8ba1a79b7a38814237508108eff9bcd5d6 (patch) | |
| tree | 189891f303469c54ee88d36269f382db55b147c1 /examples/host/audio_host | |
| parent | c950109bcef6404971c3609a6e4caeb0421120b8 (diff) | |
fix(audio): repair the host audio example build
Add the missing preset and shared declarations, remove duplicate initialization, and correct callback call sites so the new example builds through the normal CMake flow.
Signed-off-by: HiFiPHile <[email protected]>
Diffstat (limited to 'examples/host/audio_host')
| -rw-r--r-- | examples/host/audio_host/CMakePresets.json | 6 | ||||
| -rw-r--r-- | examples/host/audio_host/src/app.h | 1 | ||||
| -rw-r--r-- | examples/host/audio_host/src/audio_app.c | 4 | ||||
| -rw-r--r-- | examples/host/audio_host/src/main.c | 2 |
4 files changed, 9 insertions, 4 deletions
diff --git a/examples/host/audio_host/CMakePresets.json b/examples/host/audio_host/CMakePresets.json new file mode 100644 index 000000000..5cd8971e9 --- /dev/null +++ b/examples/host/audio_host/CMakePresets.json @@ -0,0 +1,6 @@ +{ + "version": 6, + "include": [ + "../../../hw/bsp/BoardPresets.json" + ] +} diff --git a/examples/host/audio_host/src/app.h b/examples/host/audio_host/src/app.h index 3ebb5c16d..474544a19 100644 --- a/examples/host/audio_host/src/app.h +++ b/examples/host/audio_host/src/app.h @@ -21,6 +21,7 @@ #include <stdbool.h> #include <stdint.h> +void led_blinking_task(void); void audio_app_task_read(void); void audio_app_task_write(void); void defer_queue_task(void); diff --git a/examples/host/audio_host/src/audio_app.c b/examples/host/audio_host/src/audio_app.c index 40ad620bf..c3bd59abf 100644 --- a/examples/host/audio_host/src/audio_app.c +++ b/examples/host/audio_host/src/audio_app.c @@ -240,7 +240,7 @@ void led_blinking_task(void) { err_cb_count = 0; #endif -#if 0 +#if 0 // Print the current Feature Unit volume, which is set to 0x0600 in mic_configured() and can be changed by the device. uint16_t volume = 0x0001; tuh_audio_feature_unit_get_sync(audio_idx, AUDIO10_FU_CTRL_VOLUME, 0, &volume); @@ -412,7 +412,7 @@ void tuh_audio_umount_cb(uint8_t idx) { } } -void tuh_audio_mount_async(uintptr_t param) { +static void tuh_audio_mount_async(uintptr_t param) { uint8_t idx = (uint8_t)param; if (idx >= CFG_TUH_AUDIO_MAX) { printf("Audio device mount failed: idx=%u exceeds max=%u\r\n", idx, CFG_TUH_AUDIO_MAX); diff --git a/examples/host/audio_host/src/main.c b/examples/host/audio_host/src/main.c index 77c28cf41..3a3e18ab7 100644 --- a/examples/host/audio_host/src/main.c +++ b/examples/host/audio_host/src/main.c @@ -25,7 +25,6 @@ //--------------------------------------------------------------------+ // MACRO CONSTANT TYPEDEF PROTYPES //--------------------------------------------------------------------+ -void led_blinking_task(void); /*------------- MAIN -------------*/ int main(void) { @@ -39,7 +38,6 @@ int main(void) { tusb_init(BOARD_TUH_RHPORT, &host_init); board_init_after_tusb(); - uint32_t last_ms = tusb_time_millis_api(); while (1) { // tinyusb host task tuh_task(); |
