diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dbaa1d90..ad76b48aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. - Display descriptor for ST7735 128x160 display - Matter support for Occupancy via Switch (experimental) - Berry RS256 crypto algorithm (RSASSA-MCKS1_v1-5 with SHA256) used for JWT +- Berry add `set_lsb_justified(bool)` to `AudioOutputI2S` ### Breaking Changed - Matter relay number starts at 1 instead of 0 to match Tasmota numbering diff --git a/lib/libesp32/berry_tasmota/src/be_i2s_audio_lib.cpp b/lib/libesp32/berry_tasmota/src/be_i2s_audio_lib.cpp index 4ff02c6e1..9ded69468 100644 --- a/lib/libesp32/berry_tasmota/src/be_i2s_audio_lib.cpp +++ b/lib/libesp32/berry_tasmota/src/be_i2s_audio_lib.cpp @@ -149,6 +149,14 @@ int32_t be_audio_output_consume_silence(struct bvm *vm) { #include "AudioOutputI2S.h" +// AudioOutputI2S.set_lsb_justified(gain:real) -> nil +int i2s_output_i2s_set_lsb_justified_ntv(AudioOutputI2S* out, bbool lsbJustified) { + return out->SetLsbJustified(lsbJustified); +} +int32_t i2s_output_i2s_set_lsb_justified(struct bvm *vm) { + return be_call_c_func(vm, (void*) &i2s_output_i2s_set_lsb_justified_ntv, "", ".b"); +} + extern "C" { #include "be_fixed_be_class_AudioOutput.h" @@ -196,6 +204,8 @@ class be_class_AudioOutputI2S (scope: global, name: AudioOutputI2S, super: be_cl init, func(i2s_output_i2s_init) deinit, func(i2s_output_i2s_deinit) stop, func(i2s_output_i2s_stop) + + set_lsb_justified, func(i2s_output_i2s_set_lsb_justified) } class be_class_AudioGeneratorWAV (scope: global, name: AudioGeneratorWAV, super: be_class_AudioGenerator, strings: weak) {