It has happened again. This time I know the circumstances.
I am trying to minimise my code by introducing a for loop. (see below). As soon as I compiled I received the following warning.
There is a sequel to this warning. In the past I ignored Compiler Warnings. In this case the for loop fails to work for some reason. The code looks OK.
Robin
Microsoft Windows XP [Version 5.1.2600]
© Copyright 1985-2001 Microsoft Corp.
C:\C_Stops>make
Makefile generated.
Makefile.bat generated.
Assembling MIOS SDCC wrapper
==========================================================================
Compiling main.c
Processor: 18F452
pic16_allocRegByName:963 symbol name _ReadStoredValues_d_1_1 regop= 00D471E8
gen.c:1890: WARNING: need to allocate new register by name -> _ReadStoredValues_
d_1_1
==========================================================================
Compiling pic18f452.c
Processor: 18F452
==========================================================================
Linking project
==========================================================================
Converting to project.syx
Block 003000-0033FF allocated - Checksum: 2D
Block 003400-0037FF allocated - Checksum: 26
Block 003800-003BFF allocated - Checksum: 09
Block 003C00-003FFF allocated - Checksum: 7D
Block 004000-0043FF allocated - Checksum: 09
Block 004400-0047FF allocated - Checksum: 34
Block 004800-004BFF allocated - Checksum: 60
==========================================================================
SUCCESS!
C:\C_Stops>
/////////////////////////////////////////////////////////////////////
void ReadStoredValues( unsigned char pin) //__wparam
/////////////////////////////////////////////////////////////////////
{
unsigned char memorised_stored_pin;
unsigned char d;//to increment EEprom reads
q = ((pin-1)<< 5) + 10;//determines EEProm address depending on Memory pin number.
for(d<=1; d>=13;d++)
SendDump(MIOS_EEPROM_Read(q + d));
//SendDump(MIOS_EEPROM_Read(q + 1));
MemorisedStopsSetLed (8, 14, 15, MIOS_EEPROM_Read(q + 1));//pedal stops
//SendDump(MIOS_EEPROM_Read(q + 2));
MemorisedStopsSetLed (24, 24, 25, MIOS_EEPROM_Read(q + 2));//tremelo strength
//SendDump(MIOS_EEPROM_Read(q + 3));