Error Expecting a declaration in CCS

Status
Not open for further replies.

Osawa_Odessa

Banned
Joined
Dec 31, 2012
Messages
168
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Visit site
Activity points
0
Hello,
I need your help again. I am trying to measure humidity using HS1101, pic 16F877A and CCS compiler. I have the code bellow but when I try to compliler it, there are too many error that I can't fix it.
Here is the code:
Code:
#include "main.h"
#include "var.h"
#include "lcd16x2/lcd16x2.c"
#include "hs1101/hs1101.c"
#INT_RTCC

void  ngat_timer0(void) 
{
   disable_interrupts(GLOBAL);
   set_timer0(5);
   count++;
   if(count==78)
   {
      frequency=get_timer1();
      set_timer1(0);
      count=0;
      enable_display=1;
   }
   enable_interrupts(GLOBAL);   
}

void main()
{
uint8_t str[20],humi;
DDRB=0xfe;
   DDRD=0x00;
   DDRE=0x00;
   LCD_Init();
   setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256|RTCC_8_BIT);   
   sprintf(str,"BanLinhKien.Vn");
   LCD_Puts(str);
   delay_ms(4000);
   set_timer0(5);
   set_timer1(0);
   enable_interrupts(INT_TIMER0);   
   enable_interrupts(GLOBAL);
while(TRUE)
   {
     if(enable_display)
     {
     humi=HS1101_GetHumi(frequency);
     enable_display=0;
     sprintf(str,"Do Am:%3u",humi);
     LCD_Gotoxy(0,1);
     LCD_Puts(str);
     LCD_PutChar('%');
     }
   }
}
Here there are many errors like this:
*** Error 28 "C:\USer\Odessa\Deskop\CCS\main2\var.h" Line 18(17,25): Expecting a (
...Expecting a declaration
Expecting a declaration
Expecting a declaration
Expecting a declaration
 

Attachments

  • code.rar
    5.9 KB · Views: 141

The problem is in var.h file. Maybe some declarations are missing. Remove #include "var.h" and put the below lines in your main file and make then global variables and see if it works.

uint16_t frequency=0;
uint8_t enable_display=0;
uint8_t count;
 
hello:
I use during the training period, the ML501 Vertex5 to design a MPSoCs (multiprocessor on chip), and I'll ENTERING AND the environment EDK 10.1 release for the design of two MicroBlaze processors .. .
Please, if possible, send me a guide or totorial for these dual MicroBlaze processors.
and thanks

- - - Updated - - -

hello:
I use during the training period, the ML501 Vertex5 to design a MPSoCs (multiprocessors on chip), and I'll ENTERING AND the environment EDK 10.1 release for the design of two MicroBlaze processors .. .
Please, if possible, send me a guide or totorial for these dual MicroBlaze processors.
and thanks
 

Thanks! I don't know why but now when I restart my computer it compile well.
 
Bonjours:
Est ce que le fait de créer deux microblaze avec leurs périphériques sans aucune modification du code en utilisant l'outil de xilinx EDK ,permettre de dire qu'on a achevé la partie matérielle ? et qu'il faut juste la transformér en flux binaires el l'exporter au fpga via le jtag ??
et merci.

- - - Updated - - -

Bonjours:
Est ce que le fait de créer deux microblaze avec leurs périphériques sans aucune modification du code en utilisant l'outil de xilinx EDK ,permettre de dire qu'on a achevé la partie matérielle ? et qu'il faut juste la transformér en flux binaires el l'exporter au fpga via le jtag ??
et merci.

- - - Updated - - -

Bonjours:
Est ce que le fait de créer deux microblaze avec leurs périphériques sans aucune modification du code en utilisant l'outil de xilinx EDK ,permettre de dire qu'on a achevé la partie matérielle ? et qu'il faut juste la transformér en flux binaires el l'exporter au fpga via le jtag ??
et merci.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…