Merge pull request #129 from ed-xmos/test_harness

Test harness needs access to internal state
This commit is contained in:
Ed
2020-03-16 11:18:55 +00:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ lib_xua Change Log
* ADDED: Ability to read or modify bcdDevice * ADDED: Ability to read or modify bcdDevice
* ADDED: Override USB descriptor with sampling frequency and * ADDED: Override USB descriptor with sampling frequency and
bit-resolution set at boot time. bit-resolution set at boot time.
* ADDED: Global pointer to allow external access to masterClockFreq
0.2.1 0.2.1
----- -----

View File

@@ -182,6 +182,8 @@ void XUA_Buffer(
} }
} }
// Allows us to externally modify masterClockFreq
unsafe{volatile unsigned * unsafe masterClockFreq_ptr;}
/** /**
* Buffers data from audio endpoints * Buffers data from audio endpoints
@@ -268,6 +270,8 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
unsigned masterClockFreq = DEFAULT_MCLK_FREQ; unsigned masterClockFreq = DEFAULT_MCLK_FREQ;
unsigned lastClock = 0; unsigned lastClock = 0;
unsafe{masterClockFreq_ptr = &masterClockFreq;}
unsigned clocks = 0; unsigned clocks = 0;
long long clockcounter = 0; long long clockcounter = 0;