-
Notifications
You must be signed in to change notification settings - Fork 62
HardwareSerial: use correct UART HW for TX #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to compile for CH32X033, but failed. Simple errors though:
- HardwareSerial.cpp - HardwareSerial::write -
len
should besize
- uart.c - uart_putc: USART_SendData returns void, so ending should probably be
USART_SendData(uart_handlers[obj->index]->Instance, c);
return 0; // 0 means no error
After making these changes it compiled.
(Currently still figuring out how to properly use UART2 as Serial and get PA3 working as RX on CH32X033F8P6)
@maxint-rd , thanks for the notes, I have no idea why my compiler just took that. What is the issue you are still having? I ended up implementing the RX as interrupt for concurrency reasons.
|
Hi @danielkucera - Thanks for your reply. I have things working now. In PR #145 I implemented interrupt driven RX for the CH32V003. That PR only supported Serial1. The CH32X033 has no free pins for regular RX/TX on UART1 (I also want to use SCL/SDA), so I wanted to use UART2 for serial. (RX2/TX2 on PA4/PA3). For that I 've just successfully tested adding a UART2 interrupt handler. In PR #171 I published my addition of board files for the CH32X033. In BTW. Since my X033's are those with a 0 in their number they don't have hardware I2C (or VREF). In my tests I luckily could use the SoftwareI2C library, so the chips are getting more useful by the hour :-) |
Fixes #159