nice find.
good to see some english words there. The compiler manual + cpu manuals are all in English. And the Windows tool I'm using doesn't even offer Chinese as an option.
I just implemented a circular buffer for UART0 transmission. I will post the key pieces of code here in case someone wants to do that for the blue pill -> it would be simpler for cases where the target mcu doesn't have a FIFO.
Code: Select all
// transmit on uart0 using CB
void u0CBTX(CB_TypeDef *cb) {
while (!cbEmpty(cb)) { //only if the cb isn't empty
while (uart0TXFull()) continue; //wait for TX FIFO to free up
uart0Putch(cbRead(cb)); //from a chart from the CB into uart0 FIFO
}
}
//write string to CB
void CBPuts(CB_TypeDef *cb, char *str) {
while (!cbFull(cb)) {
if (*str) cbWrite(cb, *str++); else break;
}
}
u0CBTX() gets called each time loop() executes, and u0CBPuts() updates the circular buffer if you wish to transmit new content - this piece is hardware independent.