What did I change?

This commit is contained in:
jLynx 2022-04-08 12:31:06 +12:00
parent 59d08a4203
commit 2ba74d0413

View File

@ -195,6 +195,21 @@ static PortaPackModel portapack_model() {
//audio_codec_ak4951 = H1R2 //audio_codec_ak4951 = H1R2
static audio::Codec* portapack_audio_codec() { static audio::Codec* portapack_audio_codec() {
//Remove this after testing
// if (portapack::persistent_memory::config_cpld() == 1) {
// return static_cast<audio::Codec*>(&audio_codec_wm8731);
// } else if (portapack::persistent_memory::config_cpld() == 2) {
// return static_cast<audio::Codec*>(&audio_codec_ak4951);
// }
const auto switches_state = get_switches_state();
if (switches_state[(size_t)ui::KeyEvent::Up]){
return static_cast<audio::Codec*>(&audio_codec_wm8731);
}
if (switches_state[(size_t)ui::KeyEvent::Down]){
return static_cast<audio::Codec*>(&audio_codec_ak4951);
}
/* I2C ready OK, Automatic recognition of audio chip */ /* I2C ready OK, Automatic recognition of audio chip */
return (audio_codec_wm8731.detected()) return (audio_codec_wm8731.detected())
? static_cast<audio::Codec*>(&audio_codec_wm8731) ? static_cast<audio::Codec*>(&audio_codec_wm8731)
@ -410,9 +425,13 @@ bool init() {
clock_manager.enable_codec_clocks(); clock_manager.enable_codec_clocks();
radio::init(); radio::init();
// volatile uint32_t delay2 = 1000000;
// while(delay2--);
if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) { if( !portapack::cpld::update_if_necessary(portapack_cpld_config()) ) {
// If using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once. // If using a "2021/12 QFP100", press and hold the left button while booting. Should only need to do once.
if (portapack::persistent_memory::config_cpld() != 3){ const auto switches_state = get_switches_state();
if (!switches_state[(size_t)ui::KeyEvent::Left] && portapack::persistent_memory::config_cpld() != 3){
shutdown_base(); shutdown_base();
return false; return false;
} }