跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

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

Last Updated:04/17/2017

Question:

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. 

Answer:

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.
(Example)
typedef union {
 unsigned char ByteMem;
 struct
 {
     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;
}Byte_Bitf_Member;

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