Other Parts Discussed in Thread: CC2541
I am using HIDEmuKbd example. Wrote an ISR to send a word to my computer when a button is pressed. However, I really don't understand assigning flags to an event so that OSAL can process them. I understand that the application has a task id. We can associate an event flag with the corresponding task id using osal_set_event function. Once set whenever the flag is detected by the osal, it executes the process assigned to the task id in the taskArr array. I hope I'm right so far. But what I dont really know is how to link an a user defined flag to something that the user wants to detect. For eg, it want to raise a flag when an external falling edge triggered interrupt happens on a specific input pin so that OSAL can execute the process associated. Suppose I want to configure the UART to receive data. I want to execute a particular function when a byte is received. Of course I can configure an interrupt. But what about raising a flag, so that OSAL detects it and executes the event associated. My biggest doubt is I have a certain event, but how do you tie it to a flag. I'm using cc2541.
Thanks.