Other Parts Discussed in Thread: CC2640
Hi,
I was under the assumption that an interrupt service routine (ISR) established through IntRegister() was an RTOS managed ISR and, because of that, I've been happily calling Semaphore_post() inside the ISR with no ill side-effects.
On closer inspection, IntRegister() does the same thing (ignoring a possible vector table copy from Flash to SRAM) as Hwi_plug() - it inserts a pointer to a function into the interrupt vector table.
There are several comments in various documents that zero latency ISRs are "severely restricted" as to what RTOS services they can invoke but I can't find a definitive list of what those services are. I did find one forum post where it said that you can call Hwi_post() from within a zero latency ISR but is my use case of calling Sempahore_post() acceptable?
In my case, I'm not using the semaphore for multi-threaded synchronisation. Sempahore_post()/Semaphore_pend() is being used within a single task to synchronise the task code with the ISR - briefly, the task kicks off the process of writing a block of data out through the SSI peripheral and then pends on a semaphore. The ISR responds to the SSI interrupt and loads more data until done at which time it posts to the semaphore for the task to resume work. This has been working just fine but I'm wondering if that was just luck and whether I should change the mechanism.
Any comments would be appreciated.
Regards,
AC