Does the OS implicitly use semaphores when working with the same serial bus in both the main scan and slow sequence scans?
I have already used the allotted two user-declared semaphores (SemaphoreGet), but I still have to manage communications with a serial device that is polled both in the main scan (every 1s) and in a slow sequence scan (every 10s). To ensure that the slow sequence poll doesn't occur before the device responds to the main scan poll, or vice-versa, do I need to use SemaphoreGet's, or does the OS implicitly coordinate this communication? (I'm polling a device connected to an SDM-SIO1 using the Modbusmaster function in a program running on a CR1000.) Thanks.
* Last updated by: MatthewBoyd on 6/5/2014 @ 8:11 AM *
You should either a) do the 1 sec and 10 sec poll from the main scan to ensure they happen sequentially, b) use SemaphoreGet/Release so that the second poll does not go out before the first poll gets its response, c) create your own semaphore like variable that you check before executing the polls. seems like (a) would be the best.
Thank you.