Skip to content

Commit

Permalink
Update Serial.cpp
Browse files Browse the repository at this point in the history
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
1 parent 39c72ad commit 627bb4c
Showing 1 changed file with 0 additions and 24 deletions.
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;
}

0 comments on commit 627bb4c

Please sign in to comment.