boards: cleanup serial RX DMA hrt_call_every

- remove ts_to_abstime dependency
This commit is contained in:
Daniel Agar
2021-10-06 14:39:59 -04:00
committed by GitHub
parent b40dbd3d6f
commit bbfaa4694c
30 changed files with 101 additions and 471 deletions
+3 -16
View File
@@ -167,25 +167,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
#endif // FLASH_BASED_PARAMS
#if defined(SERIAL_HAVE_RXDMA)
/* set up the serial DMA polling */
// set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
static struct hrt_call serial_dma_call;
/*
* Poll at 1ms intervals for received bytes that have not triggered
* a DMA event.
*/
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)stm32_serial_dma_poll,
NULL);
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
#endif
rgb_led(0, 255, 0, 0);
return OK;
}
+3 -17
View File
@@ -248,26 +248,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
}
#if 0 // serial DMA is not yet implemented in NuttX for stm32h7
/* set up the serial DMA polling */
#if defined(SERIAL_HAVE_RXDMA)
// set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
static struct hrt_call serial_dma_call;
struct timespec ts;
/*
* Poll at 1ms intervals for received bytes that have not triggered
* a DMA event.
*/
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)stm32_serial_dma_poll,
NULL);
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
#endif
/* initial LED state */
drv_led_start();
led_off(LED_RED);
+4 -16
View File
@@ -200,23 +200,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
}
/* set up the serial DMA polling */
#if defined(SERIAL_HAVE_RXDMA)
// set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
static struct hrt_call serial_dma_call;
struct timespec ts;
/*
* Poll at 1ms intervals for received bytes that have not triggered
* a DMA event.
*/
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)stm32_serial_dma_poll,
NULL);
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
#endif
/* initial LED state */
drv_led_start();
+2 -15
View File
@@ -252,22 +252,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
}
#if defined(SERIAL_HAVE_RXDMA)
/* set up the serial DMA polling */
// set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
static struct hrt_call serial_dma_call;
/*
* Poll at 1ms intervals for received bytes that have not triggered
* a DMA event.
*/
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)stm32_serial_dma_poll,
NULL);
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
#endif
/* initial LED state */