scottnortman wrote on Thursday, January 04, 2007:
Hi,
When coding a C project, I typically have one include file, "Include.h" where I place all of my other include files. I then put a #include "Include.h" in each *.h and *.c file of my project.
I always use the
#ifndef _FILE_H
#define _FILE_H
< stuff here >
#endif
syntax to prevent multiple inclusions of the same file.
I am having the following problems:
1) When I place the following in my "Include.h" file:
/* FreeRTOS Schedular Files, in Include.h */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
and then place this in main.c:
#include "Include.h"
my code compiles fine but FreeRTOS doesn’t work. I can’t get any tasks to execute. But when I directly put this in main:
/* FreeRTOS Schedular Files, in main.c */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
FreeeRTOS works as expected.
Any thoughts as to why this may be occurring?
2) After adding more files to my project, I attempted to compile and I got this error:
Compiling: FreeRTOSV4.1.3/FreeRTOS/Source/queue.c
avr-gcc -c -mmcu=atmega64 -I. -D GCC_MEGA_AVR -I. -g -Os -fsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused -Wa,-adhlns=FreeRTOSV4.1.3/FreeRTOS/Source/queue.lst -I./Includes -I./FreeRTOSV4.1.3/FreeRTOS/Source/include -I./FreeRTOSV4.1.3/FreeRTOS/Source/portable/GCC/ATMega64 -std=gnu99 FreeRTOSV4.1.3/FreeRTOS/Source/queue.c -o FreeRTOSV4.1.3/FreeRTOS/Source/queue.o
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:112: error: conflicting types for ‘xQueueHandle’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:36: error: previous declaration of ‘xQueueHandle’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:119: error: conflicting types for ‘xQueueCreate’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:94: error: previous declaration of ‘xQueueCreate’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:119: error: conflicting types for ‘xQueueCreate’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:94: error: previous declaration of ‘xQueueCreate’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:120: error: conflicting types for ‘xQueueSend’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:173: error: previous declaration of ‘xQueueSend’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:120: error: conflicting types for ‘xQueueSend’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:173: error: previous declaration of ‘xQueueSend’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:121: error: conflicting types for ‘uxQueueMessagesWaiting’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:275: error: previous declaration of ‘uxQueueMessagesWaiting’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:121: error: conflicting types for ‘uxQueueMessagesWaiting’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:275: error: previous declaration of ‘uxQueueMessagesWaiting’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:122: error: conflicting types for ‘vQueueDelete’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:289: error: previous declaration of ‘vQueueDelete’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:122: error: conflicting types for ‘vQueueDelete’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:289: error: previous declaration of ‘vQueueDelete’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:123: error: conflicting types for ‘xQueueSendFromISR’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:364: error: previous declaration of ‘xQueueSendFromISR’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:123: error: conflicting types for ‘xQueueSendFromISR’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:364: error: previous declaration of ‘xQueueSendFromISR’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:124: error: conflicting types for ‘xQueueReceive’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:260: error: previous declaration of ‘xQueueReceive’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:124: error: conflicting types for ‘xQueueReceive’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:260: error: previous declaration of ‘xQueueReceive’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:125: error: conflicting types for ‘xQueueReceiveFromISR’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:453: error: previous declaration of ‘xQueueReceiveFromISR’ was here
FreeRTOSV4.1.3/FreeRTOS/Source/queue.c:125: error: conflicting types for ‘xQueueReceiveFromISR’
./FreeRTOSV4.1.3/FreeRTOS/Source/include/queue.h:453: error: previous declaration of ‘xQueueReceiveFromISR’ was here
make.exe: *** [FreeRTOSV4.1.3/FreeRTOS/Source/queue.o] Error 1
Any thoughts?
Thanks,
Scott Nortman