From b609753fb6fbb73a19f21ca22466555f00a37920 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Thu, 6 Dec 2018 07:22:31 -0500 Subject: [PATCH] audio_core/lle: implement RecvData --- src/audio_core/lle/lle.cpp | 12 ++++++++++++ src/audio_core/lle/lle.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/audio_core/lle/lle.cpp b/src/audio_core/lle/lle.cpp index 7ac26e9218..4201e592de 100644 --- a/src/audio_core/lle/lle.cpp +++ b/src/audio_core/lle/lle.cpp @@ -9,8 +9,20 @@ namespace AudioCore { struct DspLle::Impl final { Teakra::Teakra teakra; + + static constexpr unsigned TeakraSlice = 20000; + void RunTeakraSlice() { + teakra.Run(TeakraSlice); + } }; +u16 DspLle::RecvData(u32 register_number) { + while (!impl->teakra.RecvDataIsReady(register_number)) { + impl->RunTeakraSlice(); + } + return impl->teakra.RecvData(static_cast(register_number)); +} + DspLle::DspLle() : impl(std::make_unique()) {} DspLle::~DspLle() = default; diff --git a/src/audio_core/lle/lle.h b/src/audio_core/lle/lle.h index d92ff88f63..8e049e9da6 100644 --- a/src/audio_core/lle/lle.h +++ b/src/audio_core/lle/lle.h @@ -13,6 +13,8 @@ public: DspLle(); ~DspLle(); + u16 RecvData(u32 register_number) override; + private: struct Impl; friend struct Impl;