Fix examples.

This commit is contained in:
NIIBE Yutaka
2018-09-26 10:47:42 +09:00
parent d4f4f80ad9
commit 43bbdb44dc
12 changed files with 49 additions and 6 deletions

View File

@@ -295,19 +295,20 @@ adc_stop (void)
int
adc_wait_completion (void)
{
struct chx_poll_head *pd_array[1] = { (struct chx_poll_head *)&adc_intr };
int i;
while (1)
{
/* Wait DMA completion */
chopstx_poll (NULL, 1, pd_array);
chopstx_intr_wait (&adc_intr);
DMA0->DSR_BCR = (1 << 24);
DMA1->DSR_BCR = (1 << 24);
adc_stop_conversion ();
chopstx_intr_done (&adc_intr);
for (i = 0; i < adc.count; i++)
*adc.p++ = (uint8_t)adc.buf[i];