mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
boards: cleanup serial RX DMA hrt_call_every
- remove ts_to_abstime dependency
This commit is contained in:
@@ -218,22 +218,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -218,22 +218,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SERIAL_HAVE_RXDMA)
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
board_pwr_init(1);
|
board_pwr_init(1);
|
||||||
|
|||||||
@@ -161,22 +161,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
(void) board_hardfault_init(2, true);
|
(void) board_hardfault_init(2, true);
|
||||||
|
|
||||||
|
|||||||
@@ -131,23 +131,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
{
|
{
|
||||||
px4_platform_init();
|
px4_platform_init();
|
||||||
|
|
||||||
/* 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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -131,23 +131,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
{
|
{
|
||||||
px4_platform_init();
|
px4_platform_init();
|
||||||
|
|
||||||
/* 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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -165,22 +165,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SERIAL_HAVE_RXDMA)
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
|
|||||||
@@ -167,25 +167,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
|
|
||||||
#endif // FLASH_BASED_PARAMS
|
#endif // FLASH_BASED_PARAMS
|
||||||
|
|
||||||
|
|
||||||
#if defined(SERIAL_HAVE_RXDMA)
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rgb_led(0, 255, 0, 0);
|
rgb_led(0, 255, 0, 0);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,26 +248,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // serial DMA is not yet implemented in NuttX for stm32h7
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
led_off(LED_RED);
|
led_off(LED_RED);
|
||||||
|
|||||||
@@ -200,23 +200,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -252,22 +252,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SERIAL_HAVE_RXDMA)
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
|
|||||||
@@ -256,23 +256,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -231,26 +231,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // serial DMA is not yet implemented in NuttX for stm32h7
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
led_off(LED_RED);
|
led_off(LED_RED);
|
||||||
|
|||||||
@@ -205,23 +205,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
#endif
|
||||||
* 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -205,23 +205,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
#endif
|
||||||
* 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -195,22 +195,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SERIAL_HAVE_RXDMA)
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
|
|||||||
@@ -241,22 +241,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -254,23 +254,10 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up the serial DMA polling */
|
#if defined(SERIAL_HAVE_RXDMA)
|
||||||
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
|
// 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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)kinetis_lpserial_dma_poll_all, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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)kinetis_lpserial_dma_poll_all,
|
|
||||||
NULL);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
|
|||||||
@@ -254,23 +254,10 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up the serial DMA polling */
|
#if defined(SERIAL_HAVE_RXDMA)
|
||||||
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
|
// 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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)kinetis_lpserial_dma_poll_all, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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)kinetis_lpserial_dma_poll_all,
|
|
||||||
NULL);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
|
|||||||
@@ -276,23 +276,10 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up the serial DMA polling */
|
#if defined(SERIAL_HAVE_RXDMA)
|
||||||
#ifdef SERIAL_HAVE_DMA
|
// 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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)imxrt_serial_dma_poll, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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)imxrt_serial_dma_poll,
|
|
||||||
NULL);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
|
|||||||
@@ -244,22 +244,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -432,22 +432,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -432,22 +432,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -267,22 +267,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/**
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
// Initial LED state.
|
// Initial LED state.
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -288,22 +288,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -255,22 +255,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SERIAL_HAVE_RXDMA)
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
|
|||||||
@@ -240,23 +240,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
@@ -240,26 +240,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // serial DMA is not yet implemented in NuttX for stm32h7
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
led_off(LED_RED);
|
led_off(LED_RED);
|
||||||
|
|||||||
@@ -242,26 +242,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // serial DMA is not yet implemented in NuttX for stm32h7
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
led_off(LED_RED);
|
led_off(LED_RED);
|
||||||
|
|||||||
@@ -205,26 +205,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // serial DMA is not yet implemented in NuttX for stm32h7
|
#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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* initial LED state */
|
/* initial LED state */
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
led_off(LED_RED);
|
led_off(LED_RED);
|
||||||
|
|||||||
@@ -267,22 +267,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_ERR, "DMA alloc FAILED\n");
|
syslog(LOG_ERR, "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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
/**
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
// Initial LED state.
|
// Initial LED state.
|
||||||
drv_led_start();
|
drv_led_start();
|
||||||
|
|||||||
Reference in New Issue
Block a user