Yup, Square brackets will cause an error when they are inside other square brackets.
There's no need to DISABLE/ENABLE inside the handler. An interrupt source can't interrupt itself like it would in ON INTERRUPT.
But I think what's happening is that the handler is being called multiple times before the rest of the program see's the data.
As a test, try something like this ...
Code:
hserin 100,timeout [databyte(1), databyte(2)]
@ INT_DISABLE RX_INT ; Disable RX Interrupt
@ INT_RETURN
This should return the first 2 bytes then disable the RX_INT.
The USART will overflow and stop working after that unless it is re-enabled quickly.
I'm not saying this is the way to properly receive data in an interrupt.
It's just a test to help understand what's going wrong.
<br>
Bookmarks