Skip to content

Commit 1fcc73b

Browse files
authored
Merge pull request #6261 from KurtE/PortSerialHooksIssue
disable on mimxrt10xx (Teensy40 41) Serial port Hooks
2 parents 4f31f1d + 49769cf commit 1fcc73b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ports/mimxrt10xx/supervisor/serial.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,28 @@
2626
* THE SOFTWARE.
2727
*/
2828

29+
#include "supervisor/serial.h"
2930
#include "py/mphal.h"
3031
#include <string.h>
31-
#include "supervisor/serial.h"
3232

3333
#include "fsl_clock.h"
3434
#include "fsl_lpuart.h"
3535

3636
// TODO: Switch this to using DEBUG_UART.
37-
37+
// If the board defined a debug uart tx or rx pin then we enable this code
38+
#if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX)
3839
// static LPUART_Type *uart_instance = LPUART1; // evk
3940
static LPUART_Type *uart_instance = LPUART4; // feather 1011
4041
// static LPUART_Type *uart_instance = LPUART2; // feather 1062
41-
4242
static uint32_t UartSrcFreq(void) {
4343
uint32_t freq;
4444

45-
/* To make it simple, we assume default PLL and divider settings, and the only variable
46-
from application is use PLL3 source or OSC source */
45+
/* To make it simple, we assume default PLL and divider settings, and the only
46+
variable from application is use PLL3 source or OSC source */
4747
/* PLL3 div6 80M */
4848
if (CLOCK_GetMux(kCLOCK_UartMux) == 0) {
49-
freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
49+
freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) /
50+
(CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
5051
} else {
5152
freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
5253
}
@@ -88,3 +89,4 @@ void port_serial_write_substring(const char *text, uint32_t len) {
8889

8990
LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len);
9091
}
92+
#endif // USE_DEBUG_PORT_CODE

0 commit comments

Comments
 (0)