diff --git a/scripts/clang_format.sh b/scripts/clang_format.sh index d0a0225e..6e799b6f 100755 --- a/scripts/clang_format.sh +++ b/scripts/clang_format.sh @@ -84,6 +84,7 @@ platform/drivers/USB/usb.h platform/targets/GDx/hwconfig.h platform/targets/linux/emulator/sdl_engine.h platform/targets/ttwrplus/pmu.h +tests/platform/mic_test.c EOF ) diff --git a/tests/platform/mic_test.c b/tests/platform/mic_test.c index 286a7a3a..9e6d6217 100644 --- a/tests/platform/mic_test.c +++ b/tests/platform/mic_test.c @@ -34,12 +34,13 @@ int main() filter_state_t dcrState; dsp_resetFilterState(&dcrState); - static const size_t numSamples = 45*1024; // 90kB - stream_sample_t *sampleBuf = ((stream_sample_t *) malloc(numSamples * - sizeof(stream_sample_t))); + static const size_t numSamples = 45 * 1024; // 90kB + void *sampleBuf = malloc(numSamples * sizeof(stream_sample_t)); pathId pi = audioPath_request(SOURCE_MIC, SINK_MCU, PRIO_TX); - streamId id = audioStream_start(pi, sampleBuf, numSamples, 8000, BUF_LINEAR | STREAM_INPUT); + streamId id = audioStream_start(pi, (stream_sample_t *)sampleBuf, + numSamples, 8000, + BUF_LINEAR | STREAM_INPUT); sleepFor(3u, 0u); platform_ledOn(GREEN); @@ -51,22 +52,22 @@ int main() sleepFor(10u, 0u); // Pre-processing gain - for(size_t i = 0; i < audio.len; i++) audio.data[i] <<= 3; + for (size_t i = 0; i < audio.len; i++) + audio.data[i] <<= 3; // DC removal dsp_dcRemoval(&dcrState, audio.data, audio.len); // Post-processing gain - for(size_t i = 0; i < audio.len; i++) audio.data[i] *= 10; + for (size_t i = 0; i < audio.len; i++) + audio.data[i] *= 10; - - uint16_t *ptr = ((uint16_t *) audio.data); - for(size_t i = 0; i < audio.len; i++) - { + uint16_t *ptr = ((uint16_t *)audio.data); + for (size_t i = 0; i < audio.len; i++) iprintf("%04x ", ptr[i]); - } - while(1) ; + while (1) + ; return 0; }