Skip to content
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

UART Protothread receive problem #31

Open
kamil321-rgb opened this issue Jan 9, 2020 · 0 comments
Open

UART Protothread receive problem #31

kamil321-rgb opened this issue Jan 9, 2020 · 0 comments

Comments

@kamil321-rgb
Copy link

Hi
I created my own board using this firmware. I have a hub which connect stm32 through ftdi uart<->usb and stm32 usb directly with hub so i can send/receive uart commands and send camera stream pretty easy. It works ok with sending message but I have problem with receiving. Code below
https://pastebin.com/ydcN6BiC
So I created thread call comm_task and sending message about fpatemperature() - its i2c query. I want to send in about 100ms so I write do while loop with YIELD_UNTIL. For sending I used SPAWN with PutSerialBuffer function. As i said this works fine.

But i created another task with getSerialBuffer to receive some commands but in this code it waits for 20 chars #define max_chars 20 and then send message.

What i want to achieve is sending messages every 100ms (no matter what) and if i receive some commands simply echo them. I could use interrupts but i suppose it could destroy my stream video and protothreads. So for my purpose its better for using protohtreads. Can somebody help me with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant