FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2009 Threads] Stuck with semaphore compiler errorsPosted by TC on July 8, 2009 I'm getting two compiler errors due to the use of semaphores that I can' t figure out - details below.
I'm compiling for an NXP LPC-2103 ARM7-TDMI micro using:
- FreeRTOS V5.3.0 - Eclipse Ganeymeded V3.4.2 - Zylin Embedded CDT V4.6.1 - YAGARTO binutils: 2.19.1 gcc: 4.3.3 newlib: 1.17.0 gdb: 6.8.50-20080308-cvs
I'm trying to use semaphores to implement deferred interrupt processing. I have:
- an init function called from main.c that creates the semaphore...
vSemaphoreCreateBinary( xI2CSemaphore );
- an isr wrapper and an isr - the isr "gives" the semaphore
xSemaphoreGiveFromISR(xI2CSemaphore, &xI2CSemaphoreWokeTask);
- a task "takes" the semaphore
if (xSemaphoreTake(xI2CSemaphore, (portTickType) 1) == pdTRUE) { I have the init function and the task in a common .c file that includes a global variable definition for the semaphore handle
xSemaphoreHandle xI2CSemaphore = NULL;
The isr wrapper and isr are in another .c file that includes an external global variable reference
extern xSemaphoreHandle xI2CSemaphore;
I get the following errors:
PROJECT/i2cISR.c:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'xI2CSemaphore' PROJECT/i2cISR.c: In function 'vI2C_ISR': PROJECT/i2cISR.c:74: error: 'xI2CSemaphore' undeclared (first use in this function)
I'm stuck. Any help is appreciated!
TC
RE: Stuck with semaphore compiler errorsPosted by Adam Turowski on July 8, 2009 Compiler doesn't understand, what xSemaphoreHandle means. Propably you forgot to include "semphr.h" file in header, where your
extern xSemaphoreHandle xI2CSemaphore;
is.
Regards, Adam
RE: Stuck with semaphore compiler errorsPosted by TC on July 8, 2009 That was it. I figured I was leaving out something obvious but I just couldn't figure it out.
Thanks for the help!
TC
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|