Sorry for the long post.
I want to store 13 variables (later on 21) in EEPROM. These will be stored in different blocks of the 256 locations, dependent on the start address (There are 6 start addresses and there will be 6 different stored blocks.
Each of the 13 variables are in reality pin numbers(DIN). The pin numbers will vary.
The function Memory_IO has been prototyped
[code]
unsigned char stored_pin[13] = { pedal_group_stored_pin,// tremelo_strength_button_state,// swell_princ_group_stored_pin,// swell_mixt_group_stored_pin,// swell_reed_group_stored_pin,// great_princ_group_stored_pin,// great_mixt_group_stored_pin,// great_reed_group_stored_pin,// pedal_couplers_group_stored_pin,// sub_oct_coupler_button_state,// swell_tremelo_select_button_state,// great_swell_coupler_button_state,// great_tremelo_select_button_state }; void Memory_IO(unsigned int start_addr, unsigned int finish_addr) // __wparam { //unsigned char value; //value = stored_pin[13] ; for(addr = start_addr; addr <= finish_addr; addr++) MIOS_EEPROM_Write(addr, stored_pin[13]); }
Compiler text
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
main.c:628: warning 24: index 13 is outside of the array bounds (array size is 1
main.c:604: warning 18: Initializer different levels of indirections
==========================================================================
Compiling pic18f452.c
Processor: 18F452
==========================================================================
Linking project
==========================================================================
Converting to project.syx
Block 003000-0033FF allocated - Checksum: 1A
Block 003400-0037FF allocated - Checksum: 30
Block 003800-003BFF allocated - Checksum: 07
Block 003C00-003FFF allocated - Checksum: 73
Block 004000-0043FF allocated - Checksum: 43
Block 004400-0047FF allocated - Checksum: 2B
==========================================================================
SUCCESS!
C:\C_Stops>
This only works if I put 13 in the for the array. Even so I get the compiler warnings.
Can anyone see whether I am on the right track and make any comments. Thanks in advance.
Robin