Problema que me trae de cabeza...

Buenas, tengo un gran problema. Tiene que ser una cosa muy tonta, pero me trae de cabeza. Bueno, el problema es que al compilar con CCS el programa que pongo a continuación, me da errores donde no debia de haberlos, particularmente al declarar una variable (int a, i;)... no sé donde falla este trasto... será por culpa de la instalacion del programa, es la primera vez que lo pruebo...

Este es el programa
Código:
/*****************************************/
#include <18F4550.h>
#use delay(clock=48000000)
/*****************************************/

#define LOADER_SIZE (0xFFF)
#define LOADER_START (0)
#define LOADER_END (LOADER_SIZE)
#define APPLICATION_START (LOADER_SIZE+1)
#define APPLICATION_END (getenv("PROGRAM_MEMORY")-1)
#define APPLICATION_ISR (APPLICATION_START+8)
#ifndef _bootloader
#build(reset=APPLICATION_START, interrupt=APPLICATION_ISR)
#org 0, LOADER_END {}
#endif

#include <lcd.c>

void wait(void);
void main()
{

   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   setup_oscillator(False);
   

   
   //Led indicador todo correcto
   output_high(PIN_E0);
   delay_ms(1000);
   output_low(PIN_E0);
   //***************************
   
   while(TRUE){ //Bucle infinito
      output_high(PIN_E0);  //led rojo
      
      //Contador
      int a,i;
      a=0;
      i=0;
      if(input(PIN_B0))a++;
      for(i=0;i<a;i++){
         output_high(PIN_E2);  //led verde
         wait();
         output_low(PIN_E2);
      }
      wait();
      wait();
      wait();
   }
}

void wait(void){
delay_ms(200);
}
El pic tiene un bootloader... no sé que más decir, se me acaban las ideas...

haa ! los errores son del tipo A numeric expression must appear hereA numeric expression must appear here
Some C expression (like 123, A or B+C) must appear at this spot in the code. Some expression that will evaluate to a value.
Undefined identifierUndefined identifier
The specified identifier is being used but has never been defined. Check the spelling.

 
Última edición:
El CCS tiene bugs por todos lados. No se que version usaste, pero hice un copypaste de tu codigo y lo compile con la 4.104 y no dio ningun error.
 
Atrás
Arriba