Removed extra bracing and fixed bad comment

This commit is contained in:
xross
2022-05-20 16:19:40 +01:00
committed by Ross Owen
parent d5946b91a4
commit 0f8b9dae8c
2 changed files with 26 additions and 28 deletions

View File

@@ -665,7 +665,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, out port p, ch
/* Inspect for if we need to produce an edge */ /* Inspect for if we need to produce an edge */
if ((adatCounters.receivedSamples >= adatCounters.samplesPerTick)) if ((adatCounters.receivedSamples >= adatCounters.samplesPerTick))
{ {
/* Check edge is about right... S/PDIF may have changed freq... */ /* Check edge is about right... ADAT may have changed freq... */
if (timeafter(adatReceivedTime, (timeLastEdge + LOCAL_CLOCK_INCREMENT - LOCAL_CLOCK_MARGIN))) if (timeafter(adatReceivedTime, (timeLastEdge + LOCAL_CLOCK_INCREMENT - LOCAL_CLOCK_MARGIN)))
{ {
/* Record edge time */ /* Record edge time */

View File

@@ -255,50 +255,48 @@ static inline void GiveSamplesToDevice(chanend c, xc_ptr ptr, xc_ptr multOut)
#if(NUM_USB_CHAN_OUT == 0) #if(NUM_USB_CHAN_OUT == 0)
outuint(c, 0); outuint(c, 0);
#else #else
{
#pragma loop unroll #pragma loop unroll
for (int i=0; i<NUM_USB_CHAN_OUT; i++) for (int i=0; i<NUM_USB_CHAN_OUT; i++)
{ {
int sample, x; int sample, x;
#if defined(OUT_VOLUME_IN_MIXER) && defined(OUT_VOLUME_AFTER_MIX) #if defined(OUT_VOLUME_IN_MIXER) && defined(OUT_VOLUME_AFTER_MIX)
int mult; int mult;
int h; int h;
unsigned l; unsigned l;
#endif #endif
int index; int index;
#if MAX_MIX_COUNT > 0 #if MAX_MIX_COUNT > 0
/* If mixer turned on sort out the channel mapping */ /* If mixer turned on sort out the channel mapping */
/* Read pointer to sample from the map */ /* Read pointer to sample from the map */
read_via_xc_ptr_indexed(index, ptr, i); read_via_xc_ptr_indexed(index, ptr, i);
/* Read the actual sample value */ /* Read the actual sample value */
read_via_xc_ptr_indexed(sample, samples, index); read_via_xc_ptr_indexed(sample, samples, index);
#else #else
unsafe unsafe
{ {
/* Read the actual sample value */ /* Read the actual sample value */
sample = ptr_samples[i]; sample = ptr_samples[i];
} }
#endif #endif
#if defined(OUT_VOLUME_IN_MIXER) && defined(OUT_VOLUME_AFTER_MIX) #if defined(OUT_VOLUME_IN_MIXER) && defined(OUT_VOLUME_AFTER_MIX)
/* Do volume control processing */ /* Do volume control processing */
#warning OUT Vols in mixer, AFTER mix & map #warning OUT Vols in mixer, AFTER mix & map
read_via_xc_ptr_indexed(mult, multOut, i); read_via_xc_ptr_indexed(mult, multOut, i);
{h, l} = macs(mult, sample, 0, 0); {h, l} = macs(mult, sample, 0, 0);
h<<=3; // Shift used to be done in audio thread but now done here incase of 32bit support h<<=3; // Shift used to be done in audio thread but now done here incase of 32bit support
#error #error
#if (STREAM_FORMAT_OUTPUT_RESOLUTION_32BIT_USED == 1) #if (STREAM_FORMAT_OUTPUT_RESOLUTION_32BIT_USED == 1)
h |= (l >>29)& 0x7; // Note: This step is not required if we assume sample depth is 24bit (rather than 32bit) h |= (l >>29)& 0x7; // Note: This step is not required if we assume sample depth is 24bit (rather than 32bit)
// Note: We need all 32bits for Native DSD // Note: We need all 32bits for Native DSD
#endif #endif
outuint(c, h); outuint(c, h);
#else #else
outuint(c, sample); outuint(c, sample);
#endif #endif
}
} }
#endif #endif
} }