HardwareSerial: use correct UART HW for TX#180
HardwareSerial: use correct UART HW for TX#180danielkucera wants to merge 2 commits intoopenwch:mainfrom
Conversation
maxint-rd
left a comment
There was a problem hiding this comment.
Tried to compile for CH32X033, but failed. Simple errors though:
- HardwareSerial.cpp - HardwareSerial::write -
lenshould 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