diff --git a/usermodule/mp_audio.c b/usermodule/mp_audio.c index 8ecaf0af3487f43a6b6b43066860de977966004c..80fba2d9c133dba0bbad98fcd1f52b28c095318e 100644 --- a/usermodule/mp_audio.c +++ b/usermodule/mp_audio.c @@ -251,9 +251,15 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_input_thru_get_mute_obj, mp_input_thru_get_m STATIC mp_obj_t mp_codec_i2c_write(mp_obj_t reg_in, mp_obj_t data_in) { +#if defined(CONFIG_BADGE23_HW_GEN_P3) || defined(CONFIG_BADGE23_HW_GEN_P4) || defined(CONFIG_BADGE23_HW_GEN_P6) uint8_t reg = mp_obj_get_int(reg_in); uint8_t data = mp_obj_get_int(data_in); audio_codec_i2c_write(reg, data); +#elif defined(CONFIG_BADGE23_HW_GEN_P1) + mp_raise_NotImplementedError(MP_ERROR_TEXT("not implemented for p1 badges")); +#else +#error "audio not implemented for this badge generation" +#endif return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mp_codec_i2c_write_obj, mp_codec_i2c_write);