From d462ccef3b89df3ec73aa215a400a29acd601f66 Mon Sep 17 00:00:00 2001 From: Serge Bazanski <q3k@q3k.org> Date: Thu, 22 Jun 2023 00:25:01 +0200 Subject: [PATCH] usermodule/audio: fix build on p1 --- usermodule/mp_audio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usermodule/mp_audio.c b/usermodule/mp_audio.c index 8ecaf0af34..80fba2d9c1 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); -- GitLab