Closed burakenez closed 8 years ago
I have to ask, why are you posting this as pull request?
Because this is not working since USART6 and USART2 is mixed up in this code.
What is mixed up here? I dont understand.
Firstly, the following line of code is not correct. Both of them should be USART2 or USART6, because there is only one of them initialized.
TM_USART_Putc(USART2, TM_USART_Getc(USART6));
Secondly, following condition is always true, because in buffer library, you used return -1 instead of return 0.
if (TM_USART_FindString(USART2, "OK"))
Thirly, i checked usart example from your website, you used USART6 there and following comment line proves that you changed USART6 and changed it to USART2 but i think you forgot to change following line of comment.
/* Init USART, TX: PC6, RX: PC7, 921600 bauds */
and you are welcome. By the way, i spent 2 years reading your libraries.
Ok, I see now.
I made buffer library in Visual studio and test it on PC and last time it worked OK. So I wanna know what data you actually send. What is "first string which does not have OK inside?"
Nice to hear. What have you learn in this 2 years about libraries?
Editted: I think it is because of buffer size, which is equal to 32 I changed previous message because it worked. But this one didn't work.
Sent Data> OK Received Data> OK Sent Data> 1234 OK Received Data> 1234 OK Sent Data> 0123456789 Received Data> Sent Data> 0123456789 Received Data> Sent Data> 0123456789 Received Data> Sent Data> 1234 OK Received Data>
Actually, i learned a lot. Even, I write my codes in same way you write. Now, if i read your code i can see what you think :D You can't imagine how painful was writing any kind of code in stm32 without these libraries of yours. Thank you very much.
Some corrections... Troubles: After new changes, there is still problem. If i send a string with "OK" in it, i receive same string back. If i send some strings which has no "OK" in it and after that if i send a string with "OK" in it again, then i don't receive any string at all. I tried to solve it, but i couldn't. Could you check it?