Hi guys,
When creating a va_list containing a 64bit number, and later on popping this number off, it isnt the same value anymore.
Doing this before the kernel is started works like expected, but doing the same thing from within a thread fails.
The routine is something like this:
~~~
define BIGNUMBER ( 1ULL << 63 )
void step2(int ignoreme, va
list args){
unsigned long long n = vaarg(args, unsigned long long);
if(n == BIGNUMBER){
LED_GREEN();
}else{
LED_RED();
}
}
void step1(int ignoreme, …){
va
list args;
vastart(args, ignoreme);
step2(ignoreme, args);
va_end(args);
}
…
step1(1234, BIGNUMBER);
~~~
So all this does is passing a 64bit number through var args to a processing function that checks if the received value equals the value that was passed to it.
Attached is a quickly made MPLABX project demonstrating this if it’s not clear.
CPU is the PIC32MX695F512L, compiler XC32.
I think it has to be a FreeRTOS problem (or at least in its PIC32MX port) because again, it does work like expected when doing this if FreeRTOS is not used. Also it works when using another RTOS.
Anyone has ideas about what could be wrong?