test: platform: mic_test: reformat code to new coding style

pull/336/head
Silvano Seva 2025-09-12 16:23:34 +02:00
rodzic d18905aeb4
commit b2e289e6fd
2 zmienionych plików z 14 dodań i 12 usunięć

Wyświetl plik

@ -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
)

Wyświetl plik

@ -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;
}