Skip to content

Commit 627bb4c

Browse files
authored
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.
1 parent 39c72ad commit 627bb4c

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

cores/arduino/Serial.cpp

-24
Original file line numberDiff line numberDiff line change
@@ -341,27 +341,3 @@ size_t UART::write_raw(uint8_t* c, size_t len) {
341341
}
342342
return len;
343343
}
344-
345-
/* -------------------------------------------------------------------------- */
346-
size_t UART::write_9bit(uint8_t c, bool wake) {
347-
/* -------------------------------------------------------------------------- */
348-
uint16_t bit = 0x00;
349-
if (wake) {bit = 0x100;}
350-
uart_ctrl.p_reg->TDRHL = 0xFC00 + bit + c;
351-
while (uart_ctrl.p_reg->SSR_b.TEND == 0) {}
352-
return 1;
353-
}
354-
355-
/* -------------------------------------------------------------------------- */
356-
size_t UART::write_9bit(uint8_t* c, bool wake, size_t len) {
357-
/* -------------------------------------------------------------------------- */
358-
size_t i = 0;
359-
uint16_t bit = 0x00;
360-
if (wake) {bit = 0x100;}
361-
while (i < len) {
362-
uart_ctrl.p_reg->TDRHL = *(c+i) + 0xFC00 + bit;
363-
while (uart_ctrl.p_reg->SSR_b.TEND == 0) {}
364-
i++;
365-
}
366-
return len;
367-
}

0 commit comments

Comments
 (0)