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

Subversion Repositories gecko3

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

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 21 Rev 33
Line 67... Line 67...
 
 
 
 
int8_t fpga_scan_file(const xdata unsigned char *p, idata uint16_t *offset, \
int8_t fpga_scan_file(const xdata unsigned char *p, idata uint16_t *offset, \
                       idata uint16_t *length, xdata Fpga_Info* info)
                       idata uint16_t *length, xdata Fpga_Info* info)
{
{
  idata uint8_t string_length = 0, chars_left_to_read = 0;
  static idata uint8_t string_length = 0, chars_left_to_read = 0;
  xdata uint16_t local_position = *offset;
  xdata uint16_t local_position = *offset;
 
 
  for(local_position; local_position < *length; local_position++) {
  for(local_position; local_position < *length; local_position++) {
    //printf_tiny("fi: %d\n",local_position);
 
    /* information found, copy data to output array */
    /* information found, copy data to output array */
    if(chars_left_to_read < string_length) {
    if(chars_left_to_read < string_length) {
 
      //printf_tiny("fi: %d\n",local_position);
      info->info[chars_left_to_read++] = p[local_position];
      info->info[chars_left_to_read++] = p[local_position];
 
 
      /* end of information, return successfull */
      /* end of information, return successfull */
      if(chars_left_to_read == string_length) {
      if(chars_left_to_read == string_length) {
 
        //print_info("l\n");
        info->position = local_position;
        info->position = local_position;
        *offset = local_position+1;
        *offset = local_position+1;
 
        string_length = 0;
 
        chars_left_to_read = 0;
        return FPGA_INFO_COMPLETE;
        return FPGA_INFO_COMPLETE;
      }
      }
      else {
      else {
        continue; /* ignore rest of these loop, load next character */
        continue; /* ignore rest of these loop, load next character */
      }
      }

powered by: WebSVN 2.1.0

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