mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-19 12:24:18 -04:00
Extract function that returns audio codec based on hardware revision.
This commit is contained in:
parent
dec4e41189
commit
e85fb47a49
1 changed files with 8 additions and 5 deletions
|
@ -134,6 +134,13 @@ static PortaPackModel portapack_model() {
|
||||||
return model.value();
|
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() {
|
static const portapack::cpld::Config& portapack_cpld_config() {
|
||||||
return (portapack_model() == PortaPackModel::R2_20170522)
|
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||||
? portapack::cpld::rev_20170522::config
|
? portapack::cpld::rev_20170522::config
|
||||||
|
@ -192,11 +199,7 @@ void init() {
|
||||||
|
|
||||||
portapack::io.init();
|
portapack::io.init();
|
||||||
|
|
||||||
if( portapack_model() == PortaPackModel::R2_20170522 ) {
|
audio::init(portapack_audio_codec());
|
||||||
audio::init(&audio_codec_ak4951);
|
|
||||||
} else {
|
|
||||||
audio::init(&audio_codec_wm8731);
|
|
||||||
}
|
|
||||||
|
|
||||||
clock_manager.enable_first_if_clock();
|
clock_manager.enable_first_if_clock();
|
||||||
clock_manager.enable_second_if_clock();
|
clock_manager.enable_second_if_clock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue