mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
Audio: Use correct codec based on hardware revision.
This commit is contained in:
parent
6e5549f127
commit
4332bc763e
@ -122,6 +122,7 @@ set(CPPSRC
|
||||
clock_manager.cpp
|
||||
si5351.cpp
|
||||
${COMMON}/wm8731.cpp
|
||||
${COMMON}/ak4951.cpp
|
||||
radio.cpp
|
||||
baseband_cpld.cpp
|
||||
tuning.cpp
|
||||
|
@ -36,6 +36,9 @@ using namespace hackrf::one;
|
||||
#include "wm8731.hpp"
|
||||
using wolfson::wm8731::WM8731;
|
||||
|
||||
#include "ak4951.hpp"
|
||||
using asahi_kasei::ak4951::AK4951;
|
||||
|
||||
#include "cpld_update.hpp"
|
||||
|
||||
#include "optional.hpp"
|
||||
@ -67,6 +70,7 @@ ClockManager clock_manager {
|
||||
};
|
||||
|
||||
WM8731 audio_codec_wm8731 { i2c0, 0x1a };
|
||||
AK4951 audio_codec_ak4951 { i2c0, 0x12 };
|
||||
|
||||
ReceiverModel receiver_model;
|
||||
|
||||
@ -180,7 +184,11 @@ void init() {
|
||||
|
||||
portapack::io.init();
|
||||
|
||||
audio::init(&audio_codec_wm8731);
|
||||
if( portapack_model() == PortaPackModel::R2_20170522 ) {
|
||||
audio::init(&audio_codec_ak4951);
|
||||
} else {
|
||||
audio::init(&audio_codec_wm8731);
|
||||
}
|
||||
|
||||
clock_manager.enable_first_if_clock();
|
||||
clock_manager.enable_second_if_clock();
|
||||
|
Loading…
Reference in New Issue
Block a user