teensy 3 and interrupt error

Status
Not open for further replies.

stephanschulz

Well-known member
i am trying to work with interrupts and tried this simple example.
but it does not compile.
i get this error:
error: expected constructor, destructor, or type conversion before '(' token

i am on osx 10.8.5 arduion IDE 1.0.5, downloaded teensy just yersterday.

???

thanks.

Code:
#include <avr/io.h>
#include <avr/interrupt.h>

volatile unsigned int overflow_count=0;


void setup(){
  Serial1.begin(250000);
}

void loop(){
  
}

ISR(TIMER0_OVF_vect)
{
    /* Timer 0 overflow */
    if (overflow_count < 0xFFFF) overflow_count++;
}
 
That example is for AVR processors, Teensy 2's.
Teensy 3 needs ARM interrupt code.
 
thanks. as you probably noticed from my other post, i am trying to get DMX receiving working. so the interrupt should be called when data comes in on the serial1 RX pin.
The DMXreceiver library you pointed me to works fine.

thanks.
 
Status
Not open for further replies.
Back
Top