Skip to content
Prev Previous commit
Next Next commit
Update Serial.cpp
I removed two unnecessary functions that I added with this pull request to turn on 9bit. There was a little code cleanup /refactoring.
  • Loading branch information
vashadow authored Oct 13, 2024
commit 627bb4c44bf7f2ef1c091f5ef758d618f7ce21ec
24 changes: 0 additions & 24 deletions cores/arduino/Serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,27 +341,3 @@ size_t UART::write_raw(uint8_t* c, size_t len) {
}
return len;
}

/* -------------------------------------------------------------------------- */
size_t UART::write_9bit(uint8_t c, bool wake) {
/* -------------------------------------------------------------------------- */
uint16_t bit = 0x00;
if (wake) {bit = 0x100;}
uart_ctrl.p_reg->TDRHL = 0xFC00 + bit + c;
while (uart_ctrl.p_reg->SSR_b.TEND == 0) {}
return 1;
}

/* -------------------------------------------------------------------------- */
size_t UART::write_9bit(uint8_t* c, bool wake, size_t len) {
/* -------------------------------------------------------------------------- */
size_t i = 0;
uint16_t bit = 0x00;
if (wake) {bit = 0x100;}
while (i < len) {
uart_ctrl.p_reg->TDRHL = *(c+i) + 0xFC00 + bit;
while (uart_ctrl.p_reg->SSR_b.TEND == 0) {}
i++;
}
return len;
}