Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no response on Serial* with high BAUDRATE #47

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cores/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <Stream.h>

extern "C" {
#include <lpc17xx_clkpwr.h>
#include <lpc17xx_uart.h>
#include "lpc17xx_pinsel.h"
}
Expand Down Expand Up @@ -102,6 +103,7 @@ class HardwareSerial : public Stream {
PINSEL_ConfigPin(&PinCfg);
PinCfg.Pinnum = 3;
PINSEL_ConfigPin(&PinCfg);
CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART0, CLKPWR_PCLKSEL_CCLK_DIV_1);
} else if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) {
// Initialize UART1 pin connect
PinCfg.OpenDrain = 0;
Expand All @@ -122,7 +124,7 @@ class HardwareSerial : public Stream {
PinCfg.Pinnum = 16;
PINSEL_ConfigPin(&PinCfg);
#endif

CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART1, CLKPWR_PCLKSEL_CCLK_DIV_1);
} else if (UARTx == LPC_UART2) {
// Initialize UART2 pin connect
PinCfg.OpenDrain = 0;
Expand All @@ -143,7 +145,7 @@ class HardwareSerial : public Stream {
PinCfg.Pinnum = 11;
PINSEL_ConfigPin(&PinCfg);
#endif

CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART2, CLKPWR_PCLKSEL_CCLK_DIV_1);
} else if (UARTx == LPC_UART3) {
// Initialize UART3 pin connect
PinCfg.OpenDrain = 0;
Expand Down Expand Up @@ -171,7 +173,7 @@ class HardwareSerial : public Stream {
PinCfg.Pinnum = 1;
PINSEL_ConfigPin(&PinCfg);
#endif

CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART3, CLKPWR_PCLKSEL_CCLK_DIV_1);
}

/* Initialize UART Configuration parameter structure to default state:
Expand Down