mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-13 17:05:37 -04:00
Realize the automatic recognition of audio chip, including ak4951en/wm8731/wm8731s,Try to fix the max2837 temperature problem
This commit is contained in:
parent
603b7fb1ab
commit
a0eaa70ff4
2 changed files with 12 additions and 8 deletions
|
@ -179,20 +179,23 @@ static PortaPackModel portapack_model() {
|
|||
static Optional<PortaPackModel> model;
|
||||
|
||||
if( !model.is_valid() ) {
|
||||
if( audio_codec_wm8731.detected() ) {
|
||||
model = PortaPackModel::R1_20150901;
|
||||
} else {
|
||||
/*For the time being, it is impossible to distinguish the hardware of R1 and R2 from the software level*/
|
||||
/*At this point, I2c is not ready.*/
|
||||
//if( audio_codec_wm8731.detected() ) {
|
||||
// model = PortaPackModel::R1_20150901;
|
||||
//} else {
|
||||
model = PortaPackModel::R2_20170522;
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
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)
|
||||
/* I2C ready OK, Automatic recognition of audio chip */
|
||||
return (audio_codec_wm8731.detected())
|
||||
? static_cast<audio::Codec*>(&audio_codec_wm8731)
|
||||
: static_cast<audio::Codec*>(&audio_codec_ak4951)
|
||||
;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue