Normally weak functions are implemented using either function attributes or pragmas, like this
uint16_t __attribute__((weak)) getValue(void){ ... };
uint16_t getValue(void) __attribute__((weak)){ ... };
#pragma weak getValue
uint16_t getValue(){ ... };
Unfortunately the CC-RX compiler do not yet implement support for weak functions, but since version 3.07, the assembler have supported weak symbols. By mixing c and assembly code, it's possible to archive a weak function option:
hal/myFunctions.h
#include <stdint.h>
uint16_t getValue();
hal/weak_functions.s
.SECTION P,CODE
.WEAK _getValue
.END
hal/weak_function_impl.c
#include <hal/myFunctions.h>
uint16_t getValue(){
return 0;
}
actual_function_impl.c
#include <hal/myFunctions.h>
uint16_t getValue(){
return 0;
}