mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
What did I change?
This commit is contained in:
parent
59d08a4203
commit
2ba74d0413
@ -195,6 +195,21 @@ static PortaPackModel portapack_model() {
|
||||
//audio_codec_ak4951 = H1R2
|
||||
|
||||
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 */
|
||||
return (audio_codec_wm8731.detected())
|
||||
? static_cast<audio::Codec*>(&audio_codec_wm8731)
|
||||
@ -410,9 +425,13 @@ bool init() {
|
||||
clock_manager.enable_codec_clocks();
|
||||
radio::init();
|
||||
|
||||
// volatile uint32_t delay2 = 1000000;
|
||||
// while(delay2--);
|
||||
|
||||
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 (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();
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user