mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Extract function that returns audio codec based on hardware revision.
This commit is contained in:
parent
dec4e41189
commit
e85fb47a49
@ -134,6 +134,13 @@ static PortaPackModel portapack_model() {
|
||||
return model.value();
|
||||
}
|
||||
|
||||
static audio::Codec* portapack_audio_codec() {
|
||||
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||
? static_cast<audio::Codec*>(&audio_codec_ak4951)
|
||||
: static_cast<audio::Codec*>(&audio_codec_wm8731)
|
||||
;
|
||||
}
|
||||
|
||||
static const portapack::cpld::Config& portapack_cpld_config() {
|
||||
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||
? portapack::cpld::rev_20170522::config
|
||||
@ -192,11 +199,7 @@ void init() {
|
||||
|
||||
portapack::io.init();
|
||||
|
||||
if( portapack_model() == PortaPackModel::R2_20170522 ) {
|
||||
audio::init(&audio_codec_ak4951);
|
||||
} else {
|
||||
audio::init(&audio_codec_wm8731);
|
||||
}
|
||||
audio::init(portapack_audio_codec());
|
||||
|
||||
clock_manager.enable_first_if_clock();
|
||||
clock_manager.enable_second_if_clock();
|
||||
|
Loading…
Reference in New Issue
Block a user