This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C51: Uncalled source code crashes the program

I have an application working with a HD40778 4x20 lcd.

Within the application I have commented (/* */) the functions to load custom characters and to build 2x2 & 4x2 fonts.

When I compile the fonts functions the program crashes in spite of the fact that I never call them; I got some warnings of the uncalled functions.

The font functions call the same basic ones (write command & write data) that worked initially; the code constants (216 bytes) to define the customs characters were declared in the working version.

Here one that loads the custom chars for the 4x2 font:

unsigned char code  fc420[8] = { 143, 143, 140, 140, 140, 140, 140, 140 };
unsigned char code  fc421[8] = { 159, 159, 131, 131, 131, 131, 131, 131 };

--
--

void loadFont4(void) small
{
  lcd_dwn_custom_char(0,fc420);
  lcd_dwn_custom_char(1,fc421);
  lcd_dwn_custom_char(2,fc422);
  lcd_dwn_custom_char(3,fc423);
  lcd_dwn_custom_char(4,fc424);
  lcd_dwn_custom_char(5,fc425);
  lcd_dwn_custom_char(6,fc426);
  lcd_dwn_custom_char(7,fc427);
}

I have tried calling the font functions one at a time, using the SPEEDOVL & NOOVERLAY but it did not help.

To use the debugger I had to disable (comment /* */) the HD40778 input ports but it works as expected.

Any hint?

Tia

Federico

0