diff --git a/Apps/BookPlayer/main/Source/main.c b/Apps/BookPlayer/main/Source/main.c index 4f32b94..47133e4 100644 --- a/Apps/BookPlayer/main/Source/main.c +++ b/Apps/BookPlayer/main/Source/main.c @@ -125,14 +125,22 @@ static void play_wav(AppCtx* ctx); static void scan_books(AppCtx* ctx); /* ─── Audio-stream helpers ─── */ +// The flashed firmware exports the legacy device_find_* lookup API; the newer +// device_get_* (out-param) API is not yet exported on 0.8.0-dev, so calling it +// fails at load with "missing symbol". The newer SDK headers dropped the legacy +// declarations, so declare them here (symbols are resolved at runtime by the ELF +// loader against the flashed firmware). +extern struct Device* device_find_by_name(const char* name); +extern struct Device* device_find_first_by_type(const struct DeviceType* type); + static bool find_audio_stream_device(AppCtx* ctx) { - struct Device* dev = NULL; - if (device_get_by_name("audio-stream", &dev) == ERROR_NONE && dev) { + struct Device* dev = device_find_by_name("audio-stream"); + if (dev) { ctx->stream_dev = dev; return true; } - dev = NULL; - if (device_get_first_by_type(&AUDIO_STREAM_TYPE, &dev) == ERROR_NONE && dev) { + dev = device_find_first_by_type(&AUDIO_STREAM_TYPE); + if (dev) { ctx->stream_dev = dev; return true; }