mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 05:43:33 +08:00
Create INVERT_RC_INPUT default usages
This commit is contained in:
committed by
Lorenz Meier
parent
6f3783221f
commit
c57928343c
@@ -503,10 +503,34 @@ __EXPORT int board_get_dma_usage(uint16_t *dma_total, uint16_t *dma_used, uint16
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
#if defined(INVERT_RC_INPUT)
|
|
||||||
# if !defined(GPIO_SBUS_INV)
|
/* Provide an interface for Inversion of serial data
|
||||||
__EXPORT void board_rc_input(bool invert_on);
|
*
|
||||||
# endif
|
* Case 1:Board does provide UxART based inversion
|
||||||
|
* Use it, and it will define RC_UXART_BASE
|
||||||
|
*
|
||||||
|
* Case 1:Board does provide GPIO inversion
|
||||||
|
* Use it and let board determine active state
|
||||||
|
* Define RC_UXART_BASE as empty
|
||||||
|
*
|
||||||
|
* Case 3:Board does not provide any inversions
|
||||||
|
* Default to nop
|
||||||
|
* Define RC_UXART_BASE as empty
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(RC_UXART_BASE)
|
||||||
|
__EXPORT void board_rc_input(bool invert_on, uint32_t uxart_base);
|
||||||
|
# define INVERT_RC_INPUT(_invert_true, _rc_uxart) board_rc_input((_invert_true), (_rc_uxart));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOARD_INVERT_RC_INPUT)
|
||||||
|
# define INVERT_RC_INPUT BOARD_INVERT_RC_INPUT
|
||||||
|
# define RC_UXART_BASE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(INVERT_RC_INPUT)
|
||||||
|
# define INVERT_RC_INPUT(_invert_true, _na) while(0)
|
||||||
|
# define RC_UXART_BASE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user