git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13031 27425a3e-05d8-49a3-a47f-9c15f0e5edd8

This commit is contained in:
Giovanni Di Sirio 2019-09-27 09:15:33 +00:00
parent 979f3bb2b8
commit 9c6dfb07cb
12 changed files with 166 additions and 88 deletions

View File

@ -1,52 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"> <launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
<stringAttribute key="bad_container_name" value="\RT-STM32L476-DISCOVERY-SB_HOST\debug"/> <stringAttribute key="bad_container_name" value="\RT-STM32L476-DISCOVERY-SB_HOST\debug"/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="1"/> <intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="1"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20&#13;&#10;monitor reset init&#13;&#10;monitor sleep 50&#10;load /home/giovanni/Projects/ChibiStudio/chibios_trunk/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT/build/ch.elf&#10;"/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="set remotetimeout 20&#13;&#10;monitor reset init&#13;&#10;monitor sleep 50&#13;&#10;&#10;load C:/_projects/chibios-trunk/demos/STM32/RT-STM32L476-DISCOVERY-SB_CLIENT/build/ch.elf&#10;"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/> <intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> <stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> <booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/> <stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/>
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/> <stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/>
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/> <stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/> <booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/> <stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> <intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> <stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/> <stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList&gt;&lt;content id=&quot;psp-SVC_Handler-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;s_psp-SVC_Handler-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;s_psp-port_unprivileged_jump-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r0-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r1-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r2-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;xPSR-(format)&quot; val=&quot;4&quot;/&gt;&lt;/contentList&gt;"/> <stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList&gt;&lt;content id=&quot;psp-SVC_Handler-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;s_psp-SVC_Handler-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;s_psp-port_unprivileged_jump-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r0-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r1-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;r2-(format)&quot; val=&quot;4&quot;/&gt;&lt;content id=&quot;xPSR-(format)&quot; val=&quot;4&quot;/&gt;&lt;/contentList&gt;"/>
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;globalVariableList/&gt;&#10;"/> <stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;globalVariableList/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList&gt;&#10;&lt;memoryBlockExpressionItem&gt;&#10;&lt;expression text=&quot;0x20000300&quot;/&gt;&#10;&lt;/memoryBlockExpressionItem&gt;&#10;&lt;/memoryBlockExpressionList&gt;&#10;"/> <stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList&gt;&#13;&#10;&lt;memoryBlockExpressionItem&gt;&#13;&#10;&lt;expression text=&quot;0x20000300&quot;/&gt;&#13;&#10;&lt;/memoryBlockExpressionItem&gt;&#13;&#10;&lt;/memoryBlockExpressionList&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/> <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RT-STM32L476-DISCOVERY-SB_HOST"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RT-STM32L476-DISCOVERY-SB_HOST"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/> <booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="0.603687198"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="0.603687198"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/RT-STM32L476-DISCOVERY-SB_HOST"/> <listEntry value="/RT-STM32L476-DISCOVERY-SB_HOST"/>
</listAttribute> </listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/> <listEntry value="4"/>
</listAttribute> </listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute> </listAttribute>
</launchConfiguration> </launchConfiguration>

View File

@ -80,10 +80,16 @@ OSAL_IRQ_HANDLER(STM32_EXTI10_15_HANDLER) {
OSAL_IRQ_PROLOGUE(); OSAL_IRQ_PROLOGUE();
pr = EXTI->PR1; pr = EXTI->PR1;
pr &= EXTI->IMR1 & (1U << 0); pr &= EXTI->IMR1 & ((1U << 10) | (1U << 11) | (1U << 12) | (1U << 13) |
(1U << 14) | (1U << 15));
EXTI->PR1 = pr; EXTI->PR1 = pr;
exti_serve_irq(pr, 0); exti_serve_irq(pr, 10);
exti_serve_irq(pr, 11);
exti_serve_irq(pr, 12);
exti_serve_irq(pr, 13);
exti_serve_irq(pr, 14);
exti_serve_irq(pr, 15);
OSAL_IRQ_EPILOGUE(); OSAL_IRQ_EPILOGUE();
} }

View File

@ -80,7 +80,7 @@ OSAL_IRQ_HANDLER(STM32_EXTI2_HANDLER) {
OSAL_IRQ_PROLOGUE(); OSAL_IRQ_PROLOGUE();
pr = EXTI->PR1; pr = EXTI->PR1;
pr &= EXTI->IMR1 & (1U << 0); pr &= EXTI->IMR1 & (1U << 2);
EXTI->PR1 = pr; EXTI->PR1 = pr;
exti_serve_irq(pr, 0); exti_serve_irq(pr, 0);

View File

@ -80,7 +80,7 @@ OSAL_IRQ_HANDLER(STM32_EXTI3_HANDLER) {
OSAL_IRQ_PROLOGUE(); OSAL_IRQ_PROLOGUE();
pr = EXTI->PR1; pr = EXTI->PR1;
pr &= EXTI->IMR1 & (1U << 0); pr &= EXTI->IMR1 & (1U << 3);
EXTI->PR1 = pr; EXTI->PR1 = pr;
exti_serve_irq(pr, 0); exti_serve_irq(pr, 0);

View File

@ -80,7 +80,7 @@ OSAL_IRQ_HANDLER(STM32_EXTI4_HANDLER) {
OSAL_IRQ_PROLOGUE(); OSAL_IRQ_PROLOGUE();
pr = EXTI->PR1; pr = EXTI->PR1;
pr &= EXTI->IMR1 & (1U << 0); pr &= EXTI->IMR1 & (1U << 4);
EXTI->PR1 = pr; EXTI->PR1 = pr;
exti_serve_irq(pr, 0); exti_serve_irq(pr, 0);

View File

@ -80,10 +80,15 @@ OSAL_IRQ_HANDLER(STM32_EXTI5_9_HANDLER) {
OSAL_IRQ_PROLOGUE(); OSAL_IRQ_PROLOGUE();
pr = EXTI->PR1; pr = EXTI->PR1;
pr &= EXTI->IMR1 & (1U << 0); pr &= EXTI->IMR1 & ((1U << 5) | (1U << 6) | (1U << 7) | (1U << 8) |
(1U << 9));
EXTI->PR1 = pr; EXTI->PR1 = pr;
exti_serve_irq(pr, 0); exti_serve_irq(pr, 5);
exti_serve_irq(pr, 6);
exti_serve_irq(pr, 7);
exti_serve_irq(pr, 8);
exti_serve_irq(pr, 9);
OSAL_IRQ_EPILOGUE(); OSAL_IRQ_EPILOGUE();
} }

View File

@ -48,6 +48,19 @@
#error "Invalid IRQ priority assigned to STM32_IRQ_LPUART1_PRIORITY" #error "Invalid IRQ priority assigned to STM32_IRQ_LPUART1_PRIORITY"
#endif #endif
/* Other checks.*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_LPUART1) && \
(HAL_USE_UART && STM32_UART_USE_LPUART1)
#error "LPUART1 used by multiple drivers"
#endif
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_LPUART1) || \
(HAL_USE_UART && STM32_UART_USE_LPUART1)
#define STM32_LPUART1_IS_USED TRUE
#else
#define STM32_LPUART1_IS_USED FALSE
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
@ -61,13 +74,13 @@
/*===========================================================================*/ /*===========================================================================*/
static inline void lpuart1_irq_init(void) { static inline void lpuart1_irq_init(void) {
#if defined(STM32_LPUART1_IS_USED) #if STM32_LPUART1_IS_USED
nvicEnableVector(STM32_LPUART1_NUMBER, STM32_IRQ_LPUART1_PRIORITY); nvicEnableVector(STM32_LPUART1_NUMBER, STM32_IRQ_LPUART1_PRIORITY);
#endif #endif
} }
static inline void lpuart1_irq_deinit(void) { static inline void lpuart1_irq_deinit(void) {
#if defined(STM32_LPUART1_IS_USED) #if STM32_LPUART1_IS_USED
nvicDisableVector(STM32_LPUART1_NUMBER); nvicDisableVector(STM32_LPUART1_NUMBER);
#endif #endif
} }
@ -76,8 +89,7 @@ static inline void lpuart1_irq_deinit(void) {
/* Driver interrupt handlers. */ /* Driver interrupt handlers. */
/*===========================================================================*/ /*===========================================================================*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_LPUART1) || \ #if STM32_LPUART1_IS_USED || defined(__DOXYGEN__)
defined(__DOXYGEN__)
/** /**
* @brief LPUART1 interrupt handler. * @brief LPUART1 interrupt handler.
* *

View File

@ -48,6 +48,19 @@
#error "Invalid IRQ priority assigned to STM32_IRQ_UART4_PRIORITY" #error "Invalid IRQ priority assigned to STM32_IRQ_UART4_PRIORITY"
#endif #endif
/* Other checks.*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_UART4) && \
(HAL_USE_UART && STM32_UART_USE_UART4)
#error "UART4 used by multiple drivers"
#endif
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_UART4) || \
(HAL_USE_UART && STM32_UART_USE_UART4)
#define STM32_UART4_IS_USED TRUE
#else
#define STM32_UART4_IS_USED FALSE
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
@ -61,13 +74,13 @@
/*===========================================================================*/ /*===========================================================================*/
static inline void uart4_irq_init(void) { static inline void uart4_irq_init(void) {
#if defined(STM32_UART4_IS_USED) #if STM32_UART4_IS_USED
nvicEnableVector(STM32_UART4_NUMBER, STM32_IRQ_UART4_PRIORITY); nvicEnableVector(STM32_UART4_NUMBER, STM32_IRQ_UART4_PRIORITY);
#endif #endif
} }
static inline void uart4_irq_deinit(void) { static inline void uart4_irq_deinit(void) {
#if defined(STM32_UART4_IS_USED) #if STM32_UART4_IS_USED
nvicDisableVector(STM32_UART4_NUMBER); nvicDisableVector(STM32_UART4_NUMBER);
#endif #endif
} }
@ -76,9 +89,7 @@ static inline void uart4_irq_deinit(void) {
/* Driver interrupt handlers. */ /* Driver interrupt handlers. */
/*===========================================================================*/ /*===========================================================================*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_UART4) || \ #if STM32_UART4_IS_USED || defined(__DOXYGEN__)
(HAL_USE_UART && STM32_UART_USE_UART4) || \
defined(__DOXYGEN__)
/** /**
* @brief UART4 interrupt handler. * @brief UART4 interrupt handler.
* *

View File

@ -48,6 +48,19 @@
#error "Invalid IRQ priority assigned to STM32_IRQ_UART5_PRIORITY" #error "Invalid IRQ priority assigned to STM32_IRQ_UART5_PRIORITY"
#endif #endif
/* Other checks.*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_UART5) && \
(HAL_USE_UART && STM32_UART_USE_UART5)
#error "UART5 used by multiple drivers"
#endif
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_UART5) || \
(HAL_USE_UART && STM32_UART_USE_UART5)
#define STM32_UART5_IS_USED TRUE
#else
#define STM32_UART5_IS_USED FALSE
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
@ -61,13 +74,13 @@
/*===========================================================================*/ /*===========================================================================*/
static inline void uart5_irq_init(void) { static inline void uart5_irq_init(void) {
#if defined(STM32_UART5_IS_USED) #if STM32_UART5_IS_USED
nvicEnableVector(STM32_UART5_NUMBER, STM32_IRQ_UART5_PRIORITY); nvicEnableVector(STM32_UART5_NUMBER, STM32_IRQ_UART5_PRIORITY);
#endif #endif
} }
static inline void uart5_irq_deinit(void) { static inline void uart5_irq_deinit(void) {
#if defined(STM32_UART5_IS_USED) #if STM32_UART5_IS_USED
nvicDisableVector(STM32_UART5_NUMBER); nvicDisableVector(STM32_UART5_NUMBER);
#endif #endif
} }
@ -76,9 +89,7 @@ static inline void uart5_irq_deinit(void) {
/* Driver interrupt handlers. */ /* Driver interrupt handlers. */
/*===========================================================================*/ /*===========================================================================*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_UART5) || \ #if STM32_UART5_IS_USED || defined(__DOXYGEN__)
(HAL_USE_UART && STM32_UART_USE_UART5) || \
defined(__DOXYGEN__)
/** /**
* @brief UART5 interrupt handler. * @brief UART5 interrupt handler.
* *

View File

@ -48,6 +48,19 @@
#error "Invalid IRQ priority assigned to STM32_IRQ_USART1_PRIORITY" #error "Invalid IRQ priority assigned to STM32_IRQ_USART1_PRIORITY"
#endif #endif
/* Other checks.*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART1) && \
(HAL_USE_UART && STM32_UART_USE_USART1)
#error "USART1 used by multiple drivers"
#endif
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART1) || \
(HAL_USE_UART && STM32_UART_USE_USART1)
#define STM32_USART1_IS_USED TRUE
#else
#define STM32_USART1_IS_USED FALSE
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
@ -61,13 +74,13 @@
/*===========================================================================*/ /*===========================================================================*/
static inline void usart1_irq_init(void) { static inline void usart1_irq_init(void) {
#if defined(STM32_USART1_IS_USED) #if STM32_USART1_IS_USED
nvicEnableVector(STM32_USART1_NUMBER, STM32_IRQ_USART1_PRIORITY); nvicEnableVector(STM32_USART1_NUMBER, STM32_IRQ_USART1_PRIORITY);
#endif #endif
} }
static inline void usart1_irq_deinit(void) { static inline void usart1_irq_deinit(void) {
#if defined(STM32_USART1_IS_USED) #if STM32_USART1_IS_USED
nvicDisableVector(STM32_USART1_NUMBER); nvicDisableVector(STM32_USART1_NUMBER);
#endif #endif
} }
@ -76,9 +89,7 @@ static inline void usart1_irq_deinit(void) {
/* Driver interrupt handlers. */ /* Driver interrupt handlers. */
/*===========================================================================*/ /*===========================================================================*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART1) || \ #if STM32_USART1_IS_USED|| defined(__DOXYGEN__)
(HAL_USE_UART && STM32_UART_USE_USART1) || \
defined(__DOXYGEN__)
/** /**
* @brief USART1 interrupt handler. * @brief USART1 interrupt handler.
* *

View File

@ -48,6 +48,19 @@
#error "Invalid IRQ priority assigned to STM32_IRQ_USART2_PRIORITY" #error "Invalid IRQ priority assigned to STM32_IRQ_USART2_PRIORITY"
#endif #endif
/* Other checks.*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART2) && \
(HAL_USE_UART && STM32_UART_USE_USART2)
#error "USART2 used by multiple drivers"
#endif
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART2) || \
(HAL_USE_UART && STM32_UART_USE_USART2)
#define STM32_USART2_IS_USED TRUE
#else
#define STM32_USART2_IS_USED FALSE
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
@ -61,13 +74,13 @@
/*===========================================================================*/ /*===========================================================================*/
static inline void usart2_irq_init(void) { static inline void usart2_irq_init(void) {
#if defined(STM32_USART2_IS_USED) #if STM32_USART2_IS_USED
nvicEnableVector(STM32_USART2_NUMBER, STM32_IRQ_USART2_PRIORITY); nvicEnableVector(STM32_USART2_NUMBER, STM32_IRQ_USART2_PRIORITY);
#endif #endif
} }
static inline void usart2_irq_deinit(void) { static inline void usart2_irq_deinit(void) {
#if defined(STM32_USART2_IS_USED) #if STM32_USART2_IS_USED
nvicDisableVector(STM32_USART2_NUMBER); nvicDisableVector(STM32_USART2_NUMBER);
#endif #endif
} }
@ -76,9 +89,7 @@ static inline void usart2_irq_deinit(void) {
/* Driver interrupt handlers. */ /* Driver interrupt handlers. */
/*===========================================================================*/ /*===========================================================================*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART2) || \ #if STM32_USART2_IS_USED || defined(__DOXYGEN__)
(HAL_USE_UART && STM32_UART_USE_USART2) || \
defined(__DOXYGEN__)
/** /**
* @brief USART2 interrupt handler. * @brief USART2 interrupt handler.
* *

View File

@ -48,6 +48,19 @@
#error "Invalid IRQ priority assigned to STM32_IRQ_USART3_PRIORITY" #error "Invalid IRQ priority assigned to STM32_IRQ_USART3_PRIORITY"
#endif #endif
/* Other checks.*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART3) && \
(HAL_USE_UART && STM32_UART_USE_USART3)
#error "USART3 used by multiple drivers"
#endif
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART3) || \
(HAL_USE_UART && STM32_UART_USE_USART3)
#define STM32_USART3_IS_USED TRUE
#else
#define STM32_USART3_IS_USED FALSE
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Driver exported variables. */ /* Driver exported variables. */
/*===========================================================================*/ /*===========================================================================*/
@ -61,13 +74,13 @@
/*===========================================================================*/ /*===========================================================================*/
static inline void usart3_irq_init(void) { static inline void usart3_irq_init(void) {
#if defined(STM32_USART3_IS_USED) #if STM32_USART3_IS_USED
nvicEnableVector(STM32_USART3_NUMBER, STM32_IRQ_USART3_PRIORITY); nvicEnableVector(STM32_USART3_NUMBER, STM32_IRQ_USART3_PRIORITY);
#endif #endif
} }
static inline void usart3_irq_deinit(void) { static inline void usart3_irq_deinit(void) {
#if defined(STM32_USART3_IS_USED) #if STM32_USART3_IS_USED
nvicDisableVector(STM32_USART3_NUMBER); nvicDisableVector(STM32_USART3_NUMBER);
#endif #endif
} }
@ -76,9 +89,7 @@ static inline void usart3_irq_deinit(void) {
/* Driver interrupt handlers. */ /* Driver interrupt handlers. */
/*===========================================================================*/ /*===========================================================================*/
#if (HAL_USE_SERIAL && STM32_SERIAL_USE_USART3) || \ #if STM32_USART3_IS_USED || defined(__DOXYGEN__)
(HAL_USE_UART && STM32_UART_USE_USART3) || \
defined(__DOXYGEN__)
/** /**
* @brief USART3 interrupt handler. * @brief USART3 interrupt handler.
* *