Line 304... |
Line 304... |
/* setup all stuff */
|
/* setup all stuff */
|
file_size = 0;
|
file_size = 0;
|
|
|
/* select which file slot we have to delete */
|
/* select which file slot we have to delete */
|
if(buffer[*offset] == '0') {
|
if(buffer[*offset] == '0') {
|
flash_adress = START_ADRESS_SLOT0;
|
flash_adress = start_adress_slot0(flash_dr);
|
}
|
}
|
else if(buffer[*offset] == '1'){
|
else if(buffer[*offset] == '1'){
|
flash_adress = START_ADRESS_SLOT1;
|
flash_adress = start_adress_slot1(flash_dr);
|
}
|
}
|
else {
|
else {
|
//print_err("slot\n");
|
//print_err("slot\n");
|
ieee488_status.EventStatusRegister |= bmCOMMAND_ERROR;
|
ieee488_status.EventStatusRegister |= bmCOMMAND_ERROR;
|
usb_tmc_state = TMC_STATE_IDLE;
|
usb_tmc_state = TMC_STATE_IDLE;
|
Line 403... |
Line 403... |
//print_info("new\n");
|
//print_info("new\n");
|
|
|
/* select which file slot we have to delete */
|
/* select which file slot we have to delete */
|
slot = buffer[*offset];
|
slot = buffer[*offset];
|
if(slot == '0') {
|
if(slot == '0') {
|
flash_adress = START_ADRESS_SLOT0;
|
flash_adress = start_adress_slot0(flash_dr);
|
}
|
}
|
else if(slot == '1'){
|
else if(slot == '1'){
|
flash_adress = START_ADRESS_SLOT1;
|
flash_adress = start_adress_slot1(flash_dr);
|
}
|
}
|
else {
|
else {
|
//print_err("del\n");
|
//print_err("del\n");
|
ieee488_status.EventStatusRegister |= bmCOMMAND_ERROR;
|
ieee488_status.EventStatusRegister |= bmCOMMAND_ERROR;
|
usb_tmc_state = TMC_STATE_IDLE;
|
usb_tmc_state = TMC_STATE_IDLE;
|
Line 573... |
Line 573... |
|
|
uint16_t index;
|
uint16_t index;
|
|
|
buffer = EP2FIFOBUF;
|
buffer = EP2FIFOBUF;
|
scpi_scanner.action = NOACTION;
|
scpi_scanner.action = NOACTION;
|
|
index = 0;
|
|
|
while (1){
|
while (1){
|
|
|
usb_tmc_transfer.new_transfer = 0;
|
usb_tmc_transfer.new_transfer = 0;
|
|
|
Line 945... |
Line 946... |
|
|
/* start to configure the FPGA from the configuration SPI flash */
|
/* start to configure the FPGA from the configuration SPI flash */
|
/* read which configuration, the first or second, we should use */
|
/* read which configuration, the first or second, we should use */
|
if(get_switch()){
|
if(get_switch()){
|
led_color = GREEN;
|
led_color = GREEN;
|
spi_base_adress = START_ADRESS_SLOT0;
|
spi_base_adress = start_adress_slot0(flash_dr);
|
}
|
}
|
else {
|
else {
|
led_color = RED;
|
led_color = RED;
|
spi_base_adress = START_ADRESS_SLOT1;
|
spi_base_adress = start_adress_slot1(flash_dr);
|
}
|
}
|
|
|
/* read the configuration file size from the spi flash */
|
/* read the configuration file size from the spi flash */
|
spiflash_read(&flash_dr, &spi_base_adress, response_queue.buf, 4);
|
spiflash_read(&flash_dr, &spi_base_adress, response_queue.buf, 4);
|
((idata uint8_t*)&file_size)[0] = response_queue.buf[0];
|
((idata uint8_t*)&file_size)[0] = response_queue.buf[0];
|
((idata uint8_t*)&file_size)[1] = response_queue.buf[1];
|
((idata uint8_t*)&file_size)[1] = response_queue.buf[1];
|
((idata uint8_t*)&file_size)[2] = response_queue.buf[2];
|
((idata uint8_t*)&file_size)[2] = response_queue.buf[2];
|
((idata uint8_t*)&file_size)[3] = response_queue.buf[3];
|
((idata uint8_t*)&file_size)[3] = response_queue.buf[3];
|
spi_base_adress += 4;
|
spi_base_adress += 4;
|
|
|
|
/* debug stuff */
|
|
response_queue.buf[0] = init_spiflash(&flash_dr);
|
|
IEEE488_set_mav();
|
|
response_queue.length = 1;
|
|
|
/* there is nothing to configure when the filesize is 0 or 0xFFFFFFFF */
|
/* there is nothing to configure when the filesize is 0 or 0xFFFFFFFF */
|
if(file_size == 0 || file_size == 0xFFFFFFFF) {
|
if(file_size == 0 || file_size == 0xFFFFFFFF) {
|
/* show that we don't load a config */
|
/* show that we don't load a config */
|
set_led_ext(ORANGE);
|
set_led_ext(ORANGE);
|
}
|
}
|