【简介】
在RTD 的驱动库中经常能看到如下的代码编写方式,以下是LP_UART 的驱动代码中截取的代码段。
#define UART_START_SEC_CONST_BOOLEAN #include "Uart_MemMap.h" /** @brief Table storing DMA capabilities for LPUART instances. */ static const boolean Lpuart_Uart_Ip_InstHasLoopbackEnabled[LPUART_INSTANCE_COUNT] = LPUART_UART_IP_ENABLE_INTERNAL_LOOPBACK_PER_INSTANCE; #define UART_STOP_SEC_CONST_BOOLEAN #include "Uart_MemMap.h"
上述代码的目的是为了将变量放到特定的section 中进行管理