Hi, i'm using CWide or codewarrior for eTPU and when i create for example a struct:
typedef union
{
struct
{
uint32_t B0:1;
uint32_t B1:1;
uint32_t B2:2;
uint32_t B3:4;
uint32_t B4:8;
uint32_t B5:16;
}B;
uint32_t R;
}EST;
EST Est;
if i write Est.R = 1<<30; works but when Est.B1 = 1; that's not works.
If posible write a bit like that?
Hello Demian,
CodeWarrior for ETPU supports bitfields.
I noticed there is missing .B in your usecase:
Est.B.B1 = 1;
Note:
if you expect reversed bitfield allocation please check pragma below:
<CW eTPU v10.x>\ETPU\Help\PDF\eTPU_Build_Tools_Reference.pdf
#pragma reverse_bitfields on | off | reset
Hope it helps.
Stan