Kenneth Conner

Importing Host File data into Codewarrior IDE

Discussion created by Kenneth Conner on Dec 21, 2010
Latest reply on Dec 28, 2010 by Kenneth Conner

Hello Everyone,

 

I'm trying to develop an algorithm within the CodeWarrior IDE that is shipped with the DEMOQE development board. I'm using Windows XP Pro 2002 SP3 with CodeWarrior Development Studion for Microcontrollers V6.0 Release, build 7134-30May07.

 

I'm trying to import the contents of a file into an array and this is what I have thus far:

 

#include <hidef.h>                                /* for EnableInterrupts macro */
#include "derivative.h"                           /* include peripheral declarations */
#include <stdio.h>
#include <stdlib.h>

void MCU_init(void);                              /* Device initialization function declaration */

 

void main(void){
  MCU_init();
}                                                 /* call Device Initialization */
 
  int i = 0, N = 128;
  FILE *fpin;
  unsigned int data, source[128];
 
  if((fpin = fopen("lc_350x_450y_100w_775i.txt","r")) == NULL){
    printf("\nError...opening input file!\n");
    exit();
  }
 
  for(i=1; i<=N; i++){
    if(fscanf(fpin, "%X", &data) != EOF)
      source [i] = data;
  }

  for(;:smileywink: {
    /* __RESET_WATCHDOG(); by default, COP is disabled with device init. When enabling, also reset the watchdog. */
  } /* loop forever */
  /* please make sure that you never leave main */
}

 

If I compile the code above I get the following error:

 

Error: C2450: expected: ~ (IDENT auto const extern register static typedef volatile __interrrupt

main.c  line 16

 

Can anyone explain how I can correct this error?

 

Please note that the closing brace after function MCU_init() was to eliminate a previous error the compiler flagged.

 

Thanks in advance for any insights that can be provided. All the best to everyone and happy holidays!

Outcomes