update math with itoa base

This commit is contained in:
hugogogo
2025-03-15 18:34:10 +01:00
parent ec928d14b1
commit bd23d89706
6 changed files with 59 additions and 15 deletions

View File

@@ -18,12 +18,12 @@ void uart_init() {
}
// char uart_rx(void) {
// while (!TEST(UCSR0A, RXC0)); // 20.11.2 : do nothing until there are unread data in the receive buffer (UDRn), (RXCn flag in UCSRnA register set to 1 when buffer has data)
// while (!TEST(UCSR0A, RXC0)); // 20.11.2 : do nothing until there are unread data in the receive buffer (UDRn), (RXCn flag in UCSRnA register set to 1 when buffer has data)
// return UDR0; // 20.11.1 : get data in buffer, UDRn USART I/O Data Register (read and write)
// }
void uart_tx(char c) {
while (!TEST(UCSR0A, UDRE0)); // 20.11.2 : do nothing until UDRn buffer is empty, (UDREn flag in UCSRnA register set to 1 when buffer empty)
while (!TEST(UCSR0A, UDRE0)); // 20.11.2 : do nothing until UDRn buffer is empty, (UDREn flag in UCSRnA register set to 1 when buffer empty)
UDR0 = (unsigned char) c; // 20.11.1 : Put data into buffer, UDRn USART I/O Data Register (read and write)
}
@@ -39,10 +39,10 @@ void uart_printstr_endl(const char* str) {
uart_printstr("\r\n");
}
void uart_printstr_itoa_base_endl(uint64_t value) {
;
uart_printstr(str);
uart_printstr("\r\n");
void uart_printstr_itoa_base(uint64_t value) {
char buffer[17] = {0};
int_to_string((uint16_t)value, buffer);
uart_printstr(buffer);
}
// ISR(USART_RX_vect) { // Table 12-6 : we select the code for USART Receive