jnk0le / AVR-UART-lib

extremly light uart library for AVR 8 bit microcontrollers
MIT License
105 stars 36 forks source link

NO_USART0 follow on effect #2

Closed PbZepplin closed 7 years ago

PbZepplin commented 7 years ago

Great library, good work! I tried the NO_USART0 option and generated a couple of errors, reckon the below changes might be the fix... Line 1622 of usart.h; shouldn't this be
UCSR3A_REGISTER |= (1<<U2X3_BIT); instead of UCSR3A_REGISTER |= (1<<U2X0_BIT); ?

Also, shouldn't line 5439 of usart.c be [UDR_reg_IO] "M" (_SFR_IO_ADDR(UDR1_REGISTER)), instead of of [UDR_reg_IO] "M" (_SFR_IO_ADDR(UDR0_REGISTER)), ? Hope this is constructive, haven't githubbed before :)

PbZepplin commented 7 years ago

Also, I found a similar issue; usart.c line 3631 and 3632 refer to rx1_buffer, which i would've thought should be rx2_buffer. Seems to work