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 all
is bit fields are supported in uV3???
regards
jagmeet
struct flags { unsigned int a:1; unsigned int b:1; }flag_status;
main() { flag_status.a=1; flag_status.b=1; } this test code i have written in uV3. But when i check elemnets a and b in watch window in dubug mode, i have found that they have used 16bit individual integers. but im expecting that these elemnts should use a single int space as i am specifying single bit width to the elements..wat is the problem
main() { flag_status.a:1; flag_status.b:1; } this test code i have written in uV3. But when i check elemnets a and b in watch window in dubug mode, i have found that they have used 16bit individual integers. but im expecting that these elemnts should use a single int space as i am specifying single bit width to the elements..wat is the problem
"wat is the problem"
It'll be the same as when you posted exactly the same question an hour an a half before!
A common problem with web browsers. It is quite easy to press the back button...
I am sorry but my code does not require two ints to store the bits. flag_status.a = 1; flag_status.b = 1; This will show as two ints in the watch window but if you look at the assembly code both bits are bit ordered in one int. On my test the memory word was at 0x40000004 and after the first bit assignment the value was 0x00000001 and after the second bit assignment the same memory location contains 0x00000003. Look at actual memory location in the memory window instead of the watch window. Bradford
Dear andy
compare a=1 and a:1
Thanks bradford
My doubt is clear now. Bit field is working. i have checked it in memory window