I've been fighting with the samb11 for a while, trying to get things working as a SPI slave. Once I realized I needed to just replace the interrupt handlers with my own, things are working a lot better for receive - but now I find myself fighting with the timeout I have set for ble_event_task() - 20ms is an awfully long time when the SPI clock is 1MHz.
As I was continuing to poke around the examples and various *.h files, it occurred to me that THIS is what the poorly (not?) documented "platform event" stuff is for - I can send a platform event from one or both of my SPI interrupt handlers to indicate that I'm about to need to respond quickly. (the current ISRs just put data received over SPI into a ring buffer, and transmit from a second ring buffer or send a dummy byte if that buffer is empty - but depending on what is received over SPI, I want to reply pretty quickly.
So, it looks like platform events will help me - but I'm unclear how much I can do in a platform event handler. Is it running in interrupt context? How quick do I need to be? I looked over the implementation of platform events, and they look moderately heavyweight (in relation to sending/receiving bytes over SPI, anyway), so I wonder if I could implement the non-ISR-appropriate bits of my SPI handler in the platform event handler without worrying too much about it?
Anyone have any better docs on this? (yes, I know, it's not clear they even exist. Sigh.)