OpenCores
URL https://opencores.org/ocsvn/gecko3/gecko3/trunk

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-fw/] [firmware/] [src/] [gecko3com_main.c] - Diff between revs 33 and 36

Show entire file | Details | Blame | View Log

Rev 33 Rev 36
Line 303... Line 303...
  /* Is this the first part of configuration? */
  /* Is this the first part of configuration? */
  if(usb_tmc_transfer.nbytes_rxd == 0) {
  if(usb_tmc_transfer.nbytes_rxd == 0) {
    /* 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 use */
    if(buffer[*offset] == '0') {
    if(buffer[*offset] == '0') {
      flash_adress = start_adress_slot0(flash_dr);
      flash_adress = start_adress_slot0(flash_dr);
 
      set_led_ext(GREEN);
    }
    }
    else if(buffer[*offset] == '1'){
    else if(buffer[*offset] == '1'){
      flash_adress = start_adress_slot1(flash_dr);
      flash_adress = start_adress_slot1(flash_dr);
 
      set_led_ext(RED);
    }
    }
    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 369... Line 371...
    //printf_tiny("le, %d\n",length);    
    //printf_tiny("le, %d\n",length);    
 
 
    /* if transfer finished, back to TMC idle state */
    /* if transfer finished, back to TMC idle state */
    if(file_size <= 0) {
    if(file_size <= 0) {
      file_size = 0;
      file_size = 0;
 
      fpga_load_end();
      usb_tmc_state = TMC_STATE_IDLE;
      usb_tmc_state = TMC_STATE_IDLE;
    }
    }
  }
  }
 
 
  return 1;
  return 1;
Line 404... Line 407...
 
 
    /* 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_dr);
      flash_adress = start_adress_slot0(flash_dr);
 
      set_led_ext(GREEN);
    }
    }
    else if(slot == '1'){
    else if(slot == '1'){
      flash_adress = start_adress_slot1(flash_dr);
      flash_adress = start_adress_slot1(flash_dr);
 
      set_led_ext(RED);
    }
    }
    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 986... Line 991...
 
 
  /* finished initializing GECKO3COM system */
  /* finished initializing GECKO3COM system */
  /*------------------------------------------------------------------------*/
  /*------------------------------------------------------------------------*/
 
 
  /* 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(flash_dr);
    spi_base_adress = start_adress_slot0(flash_dr);
  }
  }
  else {
  else {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.