We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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