Skip to content

Commit

Permalink
Fix no response on SERIAL* on SKR 1.3 / 1.4 / LPC176x with BAUDRATE >…
Browse files Browse the repository at this point in the history
… 250000.
  • Loading branch information
mh-dm committed Jul 3, 2021
1 parent ee4c183 commit c79c4ff
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Marlin/src/HAL/LPC1768/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/
#pragma once

#include <lpc17xx_clkpwr.h>
#include <HardwareSerial.h>
#include <WString.h>

Expand All @@ -42,7 +43,18 @@

class MarlinSerial : public HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE> {
public:
MarlinSerial(LPC_UART_TypeDef *UARTx) : HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE>(UARTx) { }
MarlinSerial(LPC_UART_TypeDef *UARTx) : HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE>(UARTx) {
// Fix no response if BAUDRATE > 250000 https://github.com/MarlinFirmware/Marlin/issues/22283
if (UARTx == LPC_UART0) {
CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART0, CLKPWR_PCLKSEL_CCLK_DIV_1);
} else if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) {
CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART1, CLKPWR_PCLKSEL_CCLK_DIV_1);
} else if (UARTx == LPC_UART2) {
CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART2, CLKPWR_PCLKSEL_CCLK_DIV_1);
} else if (UARTx == LPC_UART3) {
CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_UART3, CLKPWR_PCLKSEL_CCLK_DIV_1);
}
}

void end() {}

Expand Down

0 comments on commit c79c4ff

Please sign in to comment.