Hi, I’d like to generate usart interrupts, however I think that all of their “handler” functions are defined in “usart_hal.c”, so I am not gonna be able to define them again in the user code, right?
If this is the case how can I generate an usart interrupt?
how can I generate an usart interrupt?
Any response to this question?
Can you clarify a bit more what you're after?
And I already had proposed something like this but it was "dismissed" as no call for it
Excuse the probably ignorant idea (which I already put forward in slack) to have serialEvent() still called between iterations of loop() but maybe add a class parameter (e.g. int eventThreshold = -1) that'd, when set, also initiate an "out of order" call of serialEvent() when the buffer is filled beyond that threshold. This way noone who'd not set that parameter would ever know there was an event "initiated" version too, but the adept Particle users could still benefit of such thing.Thinking this further with eventThreshold == 0 we'd even have a way to tell main() to not call eventSerial() between loops and really go event driven, while eventThreshold > 0 would just be a safeguard against buffer overrun if loop() takes too long to not lose data.
This way you'd not exactly have an ISR but a callback triggered from an ISR which might suffice for most needs IMHO.