Register Field Union Defs "Backward Compatibility" why?
Posted: 01 Nov 2020 18:47
I don't understand why this, that I consider the better solution, is labeled "backward compatibility for...", in the "Defs" files.
Defining the register definitions as Union of Struct, with bit-mapped fields seems to me, the correct [best] way to do it. For instance, my real-life case where I want to temporarily change the Timer 1 Prescale bits. The MikroC "accepted" [apparently] way of doing it is:
But, at least to me, a far cleaner, and more standard way of doing it is [and the way I would much rather do it]:
BUT, you scare me, Mikroe, with your language!! Can I rely on this to exist in future Mikroe C compilers?! Or is this, indeed, deprecated?!?
Defining the register definitions as Union of Struct, with bit-mapped fields seems to me, the correct [best] way to do it. For instance, my real-life case where I want to temporarily change the Timer 1 Prescale bits. The MikroC "accepted" [apparently] way of doing it is:
Code: Select all
TCKPS_0_bit = 1;
TCKPS_1_bit = 1;
Code: Select all
T1CONbits.TCKPS = 0x3;