Our embedded product is based on Renesas RH850F1L Microcontroller. We have large code base written in 'C' language.
The following function returns EEPROM value to calling library.
signed short GetDeltaMin ( void )
signed short param;
NVM_Read ( ( unsigned char * ) ¶m );
return (signed short) param;
Another software module needs to control value returned by GetDeltaMin ( ). If another software module passes 1, return value from EEPROM, just like it's implemented above.
If another module passes 0, return 0 to calling library instead of returning value from EEPROM.
How to design, and code this requirement ?
I'm thinking about providing following input interface to the user or another module.
I'll create new .c and .h file as follows:
New File Activate_Deactive_I.c
void Enable_Disable ( Boolean State)
/* user will pass 1 or 0 to this function. */
/* Please finish wirting this function. */
/* How will this function interact with GetDeltaMin ( ) function above ? Please modify GetDeltaMin ( ). */
New File Activate_Deactivate.h
extern void Enable_Disable ( Boolean State); /* user will need to include this header file */
/* I don't think Activate_Deactive_I.c needs to include this header file ? */