pins_teensy.c:163:56: error: expected identifier before numeric constant

Status
Not open for further replies.

ufechner

Member
Hello,

I get the following error when compiling the file pins_teensy.c:

Code:
pins_teensy.c:163:56: error: expected identifier before numeric constant
 voidFuncPtr isr_table_portA[CORE_MAX_PIN_PORTA+1] = { [0 ... CORE_MAX_PIN_PORTA] = dummy_isr };
                                                        ^
pins_teensy.c: In lambda function:
pins_teensy.c:163:82: error: expected '{' before '=' token
 voidFuncPtr isr_table_portA[CORE_MAX_PIN_PORTA+1] = { [0 ... CORE_MAX_PIN_PORTA] = dummy_isr };

This error relates to the last five lines of the following code snipped:

Code:
static void dummy_isr() {};

typedef void (*voidFuncPtr)(void);
#if defined(KINETISK)
#ifdef NO_PORT_ISR_FASTRUN
static void port_A_isr(void);
static void port_B_isr(void);
static void port_C_isr(void);
static void port_D_isr(void);
static void port_E_isr(void);
#else
static void port_A_isr(void) __attribute__ ((section(".fastrun"), noinline, noclone ));
static void port_B_isr(void) __attribute__ ((section(".fastrun"), noinline, noclone ));
static void port_C_isr(void) __attribute__ ((section(".fastrun"), noinline, noclone ));
static void port_D_isr(void) __attribute__ ((section(".fastrun"), noinline, noclone ));
static void port_E_isr(void) __attribute__ ((section(".fastrun"), noinline, noclone ));
#endif

voidFuncPtr isr_table_portA[CORE_MAX_PIN_PORTA+1] = { [0 ... CORE_MAX_PIN_PORTA] = dummy_isr };
voidFuncPtr isr_table_portB[CORE_MAX_PIN_PORTB+1] = { [0 ... CORE_MAX_PIN_PORTB] = dummy_isr };
voidFuncPtr isr_table_portC[CORE_MAX_PIN_PORTC+1] = { [0 ... CORE_MAX_PIN_PORTC] = dummy_isr };
voidFuncPtr isr_table_portD[CORE_MAX_PIN_PORTD+1] = { [0 ... CORE_MAX_PIN_PORTD] = dummy_isr };
voidFuncPtr isr_table_portE[CORE_MAX_PIN_PORTE+1] = { [0 ... CORE_MAX_PIN_PORTE] = dummy_isr };

The compilation command was:
Code:
arm-none-eabi-g++ -mcpu=cortex-m4 -std=c++14 -x c++ -mthumb -O0  -I/home/ufechner/teensy/include -I/home/ufechner/teensy_io/include   -c -o pins_teensy.o pins_teensy.c

Any idea?

Uwe
 
This code snippets are not revealing what you are trying to achieve. Normally, there is absolutely no need to touch at the core files, but your main code should use the exported functions „as is“. If you get compile errors related to core files, there is for sure a bug in your main code or you try to use functions which are not made for that specific purpose.

Since there are higher level functions like attachInterrupt() available to the „end user“, there is normally no need to fiddle around with the GPIO port interrupt vectors.
 
Status
Not open for further replies.
Back
Top