zeni241 wrote on Thursday, July 25, 2019:
How can I print bit value of type EventBits_t in C using printf? Is it integer and I should use %d in printf? Any other method to see the current value of event Bit?
Thank you please.
zeni241 wrote on Thursday, July 25, 2019:
How can I print bit value of type EventBits_t in C using printf? Is it integer and I should use %d in printf? Any other method to see the current value of event Bit?
Thank you please.
rtel wrote on Thursday, July 25, 2019:
It is an unsigned integer, so more likely to need %u, or whatever your
library specifies to print unsigned integers.
Can’t recall without looking it up, but I think the top bits might be
used as control bits, so you may have to mask those off, or maybe they
are masked off before the bits are returned.
zeni241 wrote on Friday, July 26, 2019:
Thanks now I get correct result using below code:
EventGroupHandle_t myeventGroup;
myeventGroup = xEventGroupCreate();
int bitvalue = xEventGroupGetBits(myeventGroup);
printf("%d\n", bitvalue);
I hope I am doing it right.
rtel wrote on Friday, July 26, 2019:
Other than you are printing it as a signed value, whereas it is actually
an unsigned value.
zeni241 wrote on Friday, July 26, 2019:
Thanks Richard for your help.