min and max resetting to 0 each reset wasn't as accurate in a shortened
sampling time as making them the opposite of their potential maximums.
removed conditional serial prints as well, they were a hangover from
trying to make AudioInputAnalog & AudioOutputAnalog cooperate in a 'non
standard' order for my current pet project.
Considered renaming Dpp() to what it is abbreviating, being
DataPeak2Peak, but not sure that is a good name anyway.
Adding route() made me review dap_enable() more closely and it wasn't
doing what I intended to do before, it was ignoring I2S coming back from
Teensy, DAP was sourced from ADC as was I2S_DOUT and DAC was sourced
from DAP; Teensy received valid data from ADC but data from Teensy was
just discarded if user selected it.
unsigned short .adc_hpf(uint8_t bypass, uint8_t freeze);
unsigned short .adc_hpf(uint8_t bypass);
bypass & freeze as defined on page 34 of the SGTL5000 datasheet.
Untested, will test it personally in next couple of days but sincerely
expect it will work so committing.
Todo: Test properly. Improve comments and possibly link to wiring
example(s).
While trying to find why assigning more than one set of coefficients for
AudioFilterBiquad results in no output I discovered my check for flag
before updating other than 1st set of coefficients was flawed so I fixed
it.
I also modified the way 'data' is assigned so the assignment only occurs
once per set of coefficients, possibly not the most efficient but I like
it better than my previous method.
These changes don't appear to effect the use of AudioFilterBiquad for a
single set of coefficients and, unfortunately, it doesn't make it start
working either - implementation of a second (or more than one) set of
coefficients still results in output being silenced but the update to
updateCoefs(..) is necessary so I am committing it.
deadly simplistic peak difference measuring object, after begin() just
goes through samples and find the maximum and minimum signed values,
natural behavior of begin() is to reset the max and min, member uint16_t
Dpp() returns maximum difference seen and .stop() does what it says.
'data' needs to be reset inside the 'flag' controlled loop or
*undefined* behavior is likely when user sets 'flag' and loop repeats
without resetting 'data' to beginning of block.