Hi,
Has anyone succeded to use ArdOS with VirtualWire? I am trying to use both but it seems that the timer interrupt in the virtual wire lib cause some troubles.
I will appricaite any help
Thx
Hi,
Has anyone succeded to use ArdOS with VirtualWire? I am trying to use both but it seems that the timer interrupt in the virtual wire lib cause some troubles.
I will appricaite any help
Thx
Do you have a description of the error? Virtualwire runs off timer 1 while ArdOS runs off timer 2, so there should not be a conflict.
That said, the virtualwire library (like the Serial library) is not thread-safe and you are likely to encounter further issues after resolving the timer conflict. The usual way around this is to slow down sends through OSSleep calls.
Colin.
Colin,
Thx for your reply
I tried to use Picoos and fond similar issue with VirtualWire. In Picoos, when just adding the library of VirualWire to the project, not even calling any function, the OS didn't work properly. What I found was that when I comment digitalRead & digitalWrite it is working OK.
So now I suspect that somehow the arduino core library cause the issue. I use AT6. I also used the core.a generated by the arduino IDE and it didn't solve the issue.
Any idea why the core library cause this issue?
BTW,
Serial works fine.
Hi Eyco,
Does the code compile fine, but you get strange behaviors from digitalRead and digitalWrite? Do these strange behaviors come about when you have more than one task calling digitalRead/digitalWrite?
If so it could be a thread-safety issue, but seems unlikely to me because the routines for digitalRead/digitalWrite are fairly fast so the odds of race-conditions are quite low.
As an aside, I'm currently working on a thread-safe version of Serial (the one library that really chokes on ArdOS when >1 task is trying to read/write to Serial), but based on printf/scanf semantics instead of replicating the Serial class. Really busy with classes now so I hope to get it out by end-Dec latest.
Colin.
Colin,
I also tried freeRTOS but with no success, but then I think i found the issue.
I think it is becuase I have built the Arduino library (AT6) as C++ library but the wiring functions are C files. When I have moved the wiring functions to a seperate library it started to work.
Becuase of all the changes and tries I have done I am not sure if this is the actual reason but now I think it is working with freeRTOS. I will find a time to try it with other OS (Ardos).
Does it make any sense to you?
Thx