Skip to content

Commit b0073bb

Browse files
authored
Merge pull request #10774 from fkjagodzinski/fix-uart_irq
Fix serial IRQ handling
2 parents e9e9bf3 + 8e3ca20 commit b0073bb

File tree

17 files changed

+34
-34
lines changed

17 files changed

+34
-34
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
127127
}
128128

129129
if (serial_irq_ids[index] != 0) {
130-
if (transmit_empty)
130+
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
131131
irq_handler(serial_irq_ids[index], TxIrq);
132132

133-
if (receive_full)
133+
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
134134
irq_handler(serial_irq_ids[index], RxIrq);
135135
}
136136
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
152152
}
153153

154154
if (serial_irq_ids[index] != 0) {
155-
if (transmit_empty)
155+
if (transmit_empty && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_TxDataRegEmptyInterruptEnable))
156156
irq_handler(serial_irq_ids[index], TxIrq);
157157

158-
if (receive_full)
158+
if (receive_full && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_RxDataRegFullInterruptEnable))
159159
irq_handler(serial_irq_ids[index], RxIrq);
160160
}
161161
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL27Z/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
135135
}
136136

137137
if (serial_irq_ids[index] != 0) {
138-
if (transmit_empty)
138+
if (transmit_empty && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_TxDataRegEmptyInterruptEnable))
139139
irq_handler(serial_irq_ids[index], TxIrq);
140140

141-
if (receive_full)
141+
if (receive_full && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_RxDataRegFullInterruptEnable))
142142
irq_handler(serial_irq_ids[index], RxIrq);
143143
}
144144
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL43Z/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
135135
}
136136

137137
if (serial_irq_ids[index] != 0) {
138-
if (transmit_empty)
138+
if (transmit_empty && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_TxDataRegEmptyInterruptEnable))
139139
irq_handler(serial_irq_ids[index], TxIrq);
140140

141-
if (receive_full)
141+
if (receive_full && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_RxDataRegFullInterruptEnable))
142142
irq_handler(serial_irq_ids[index], RxIrq);
143143
}
144144
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL82Z/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
154154
}
155155

156156
if (serial_irq_ids[index] != 0) {
157-
if (transmit_empty)
157+
if (transmit_empty && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_TxDataRegEmptyInterruptEnable))
158158
irq_handler(serial_irq_ids[index], TxIrq);
159159

160-
if (receive_full)
160+
if (receive_full && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_RxDataRegFullInterruptEnable))
161161
irq_handler(serial_irq_ids[index], RxIrq);
162162
}
163163
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
127127
}
128128

129129
if (serial_irq_ids[index] != 0) {
130-
if (transmit_empty)
130+
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
131131
irq_handler(serial_irq_ids[index], TxIrq);
132132

133-
if (receive_full)
133+
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
134134
irq_handler(serial_irq_ids[index], RxIrq);
135135
}
136136
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
131131
}
132132

133133
if (serial_irq_ids[index] != 0) {
134-
if (transmit_empty)
134+
if (transmit_empty && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_TxDataRegEmptyInterruptEnable))
135135
irq_handler(serial_irq_ids[index], TxIrq);
136136

137-
if (receive_full)
137+
if (receive_full && (LPUART_GetEnabledInterrupts(uart_addrs[index]) & kLPUART_RxDataRegFullInterruptEnable))
138138
irq_handler(serial_irq_ids[index], RxIrq);
139139
}
140140
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K22F/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
127127
}
128128

129129
if (serial_irq_ids[index] != 0) {
130-
if (transmit_empty)
130+
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
131131
irq_handler(serial_irq_ids[index], TxIrq);
132132

133-
if (receive_full)
133+
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
134134
irq_handler(serial_irq_ids[index], RxIrq);
135135
}
136136
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
140140
}
141141

142142
if (serial_irq_ids[index] != 0) {
143-
if (transmit_empty)
143+
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
144144
irq_handler(serial_irq_ids[index], TxIrq);
145145

146-
if (receive_full)
146+
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
147147
irq_handler(serial_irq_ids[index], RxIrq);
148148
}
149149
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ static inline void uart_irq(uint32_t transmit_empty, uint32_t receive_full, uint
140140
}
141141

142142
if (serial_irq_ids[index] != 0) {
143-
if (transmit_empty)
143+
if (transmit_empty && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_TxDataRegEmptyInterruptEnable))
144144
irq_handler(serial_irq_ids[index], TxIrq);
145145

146-
if (receive_full)
146+
if (receive_full && (UART_GetEnabledInterrupts(uart_addrs[index]) & kUART_RxDataRegFullInterruptEnable))
147147
irq_handler(serial_irq_ids[index], RxIrq);
148148
}
149149
}

0 commit comments

Comments
 (0)