mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-28 08:49:45 -05:00
Added support for H2+
This commit is contained in:
parent
f6c496d1d3
commit
fd8bc177ad
@ -179,18 +179,24 @@ static PortaPackModel portapack_model() {
|
||||
static Optional<PortaPackModel> model;
|
||||
|
||||
if( !model.is_valid() ) {
|
||||
if( audio_codec_wm8731.detected() ) {
|
||||
model = PortaPackModel::R1_20150901;
|
||||
if( audio_codec_wm8731.detected() && audio_codec_ak4951.detected()) {
|
||||
model = PortaPackModel::R2_20170522; // H2+
|
||||
} else if( audio_codec_wm8731.detected() ) {
|
||||
model = PortaPackModel::R1_20150901; // H1R1
|
||||
} else {
|
||||
model = PortaPackModel::R2_20170522;
|
||||
model = PortaPackModel::R2_20170522; // H1R2
|
||||
}
|
||||
}
|
||||
|
||||
return model.value();
|
||||
}
|
||||
|
||||
//audio_codec_wm8731 = H1R1 & H2
|
||||
//audio_codec_ak4951 = H1R2 (China/mine)
|
||||
|
||||
static audio::Codec* portapack_audio_codec() {
|
||||
/* I2C ready OK, Automatic recognition of audio chip */
|
||||
// return static_cast<audio::Codec*>(&audio_codec_wm8731);
|
||||
return (audio_codec_wm8731.detected())
|
||||
? static_cast<audio::Codec*>(&audio_codec_wm8731)
|
||||
: static_cast<audio::Codec*>(&audio_codec_ak4951)
|
||||
|
@ -115,6 +115,10 @@ void AK4951::init() {
|
||||
// update(Register::DigitalFilterMode);
|
||||
}
|
||||
|
||||
bool AK4951::detected() {
|
||||
return reset();
|
||||
}
|
||||
|
||||
bool AK4951::reset() {
|
||||
io.audio_reset_state(true);
|
||||
|
||||
|
@ -823,6 +823,8 @@ public:
|
||||
std::string name() const override {
|
||||
return "AK4951";
|
||||
}
|
||||
|
||||
bool detected();
|
||||
|
||||
void init() override;
|
||||
bool reset() override;
|
||||
|
Loading…
Reference in New Issue
Block a user