Skip to content

Commit 8f091da

Browse files
committed
Redid zeroing in begin() to not zero non-floats
1 parent 7a57dfc commit 8f091da

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

output_spdif3_f32.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2020
* THE SOFTWARE.
2121
*/
22+
// Redid zeroing in begin() to not zero non-floats with memset(). Bob Larkin 9 Oct 2024
2223
/*
2324
http://www.hardwarebook.info/S/PDIF
2425
https://www.mikrocontroller.net/articles/S/PDIF
@@ -74,8 +75,9 @@ void AudioOutputSPDIF3_F32::begin(void)
7475

7576
block_left_1st = nullptr;
7677
block_right_1st = nullptr;
77-
memset(&block_silent, 0, sizeof(block_silent));
78-
78+
//memset(&block_silent, 0, sizeof(block_silent)); // Was 25 Aug 2024
79+
for(int i=0; i<block_silent.length; i++) // Now 25 Aug 2024 RSL
80+
block_silent.data[i] = 0.0f;
7981
config_spdif3(sample_rate_Hz);
8082
const int nbytes_mlno = 2 * 4; // 8 Bytes per minor loop
8183

@@ -140,7 +142,7 @@ void AudioOutputSPDIF3_F32::isr(void)
140142
SCB_CACHE_DCCIMVAC = (uintptr_t) dest;
141143
asm volatile("dsb");
142144
#endif
143-
145+
144146
*dest++ = f32_to_i24(*src_left++);
145147
*dest++ = f32_to_i24(*src_right++);
146148

0 commit comments

Comments
 (0)