/* flash_ram_select.c Switch statement for ram access Written by: Rod Klein Date: July 21, 1998 Rev. History: */ /* Include Files */ #include #include "VISION.h" #include "tracker.h" #include "functions.h" /* Start program */ void flash_ram_select( option, fl_data) unsigned int option; unsigned int *fl_data; { int reg = 0; char runtime[2]; unsigned int i = 0; unsigned int addr = 0; unsigned int address = 0; unsigned int data = *fl_data; switch( option) { case 1: /* Read Flash RAM */ reg = 0; read_flash_ram( reg); break; case 2: /* Multiple Read Flash RAM */ reg = 1; read_flash_ram( reg); break; case 3: /* Write Flash RAM */ write_flash_ram( &data); *fl_data = data; break; case 4: /* Load Flash RAM */ printf("\n Please have patience, this will take a while.\n"); load_flash_ram_seq(); break; case 5: /* Download Intel Hex-Record into Flash RAM */ load_flash_altera(); break; case 6: /* Download Motorola S-Record into Flash RAM */ load_s_record(); break; case 7: /* Erase Flash RAM */ printf("\n Please have patience, this will take a while.\n"); erase_flash_ram(); break; case 8: /* Sector Erase */ if( prompt_hex( "\n Sector Address to Erase [%X]? ", &addr)) erase_flash_sector(addr); break; default: bad_choice( option); break; } }