Pular para o conteúdo principal
Renesas Brasil - Knowledgebase

Bitwise access and the error code E0520020 (CC-RL)

Last Updated:04/17/2017


I am using the CC-RL compiler for RL78 devices. The error code E0520020 appears when I add “_bit.no<numeral>” before the name of a variable for bitwise access to the variable. 
E0520020: Identifier “variable_bit” is undefined. 


CC-RL does not have a facility for the output of code which controls the value of a specific bit by adding “_bit.no<numeral>” to the name of a variable.
Define the variable so that its value can be handled as either a union of bytes or bits.
typedef union {
 unsigned char ByteMem;
     unsigned char no0:1;
     unsigned char no1:1;
     unsigned char no2:1;
     unsigned char no3:1;
     unsigned char no4:1;
     unsigned char no5:1;
     unsigned char no6:1;
     unsigned char no7:1;
 } BitfMem;

volatile Byte_Bitf_Member data;

void func(void)
 data.ByteMem = 1; // Operation to assign the value 1 to the byte
 data.BitfMem.no7 = 1; // Operation to assign the value 1 to a bit

Suitable Products
e² studio
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 Family