Hi I am using this code in my program:
_inline void Local_Clear( U8 StackerID ) { U8 idata idx; idx = StackerID-3; _atomic_(0); TxSpiBuff[idx] &= 0x0fff; TxSpiBuff[idx] |= 0x3000; _endatomic_(); }
But after compiling, this error is shown: MainTask.c(804): error C185: atomic #8: out of range
I know what is happening, but I want a good solution. A solution to this problem is that I duplicate the function for each StackerID (the parameter) and eliminate it from the parameter list, so the idx will be a constant and the error is resolved. But I am seeking for a better solution.
Thanks all
The link that I posted in previous entry sugest to me that your code is broken down in more than 4 instructions by the compiler and that is why you are getting the error.
Best Regards