Hello,
I am using CCRL on RL78G13 microcontroler and I am in trouble in using DI and EI macro in r_cg_macro.h:
when I call EI ou DI in main.c everything is OK, but when I try to do the same wherever else, linker give a error "undefined external symbol "_DI"...
Does Someone has the same problem ? And the most important: how can I solve it ?!
Thank you in advance !
Francky
If the linker must searche for _EI or _DI the compiler has failed. Usually, if function calls EI() and DI() are included in the code, the compiler will translate the function names to _EI and _DI and the linker will look for these functions. BUT EI() and DI() are not really function calls. These are embedded functions (see compiler manual chapter 4.2.5). The header file r_cg_macrodriver.h changes EI() to __EI() and DI() to __DI(). Then the compiler knows that these are no function calls but that it has to use the assembler instructions "ei" and "di" directly in the code. If your linker searches for _EI and _DI, the compiler has not included r_cg_macrodriver.h in the source. Does this file exist? Is it in a directory that is listed as include directory in the compiler options? If not, is it in the same directory as the C file, where it is included?