I am porting ShiftMatrixPWM to work with the Teensy3

Status
Not open for further replies.

DrOldies

Active member
I am trying to port ShiftMatrixPWM to work with the Teensy3 and spi4teensy3. Compiling with Teensy3.0/3.1 as the target gives errors for PORT B, C and D as expected. I commented out the offending code, hoping to get a staring to to insert spi4teensy3 functions. I added <mk20dx128.h> (unfortunately there appears to be several versions of this). As soon as I comment out elcojacobs' pin configuration header "pins_arduino_compile_time.h" I get the following error for the line: ISR(TIMER1_COMPA_vect)

error: expected constructor, destructor, or type conversion before '(' token

I added in several other pin header configurations buy no luck. My version of ShiftMatrixPWM is published on githib as ShiftMatrixPWM2. This works on the UNO. Here is the relevant sections of the code:

//#include "pins_arduino_compile_time.h" // elcoojacobs own version of pins arduino
#include <core_pins.h>
#include <Arduino.h>
#include <pins_Arduino.h>
#include <mk20dx128.h>
#include <spi4teensy3.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "CShiftMatrixPWM.h"

static inline void ShiftMatrixPWM_handleInterrupt(void){
Code:
}

#ifndef _useTimer1 
//Install the Interrupt Service Routine (ISR) for Timer1 compare and match A.
ISR(TIMER1_COMPA_vect) {
	ShiftMatrixPWM_handleInterrupt();
}
#else
//Install the Interrupt Service Routine (ISR) for Timer2 compare and match A.
ISR(TIMER2_COMPA_vect) {
	ShiftMatrixPWM_handleInterrupt();
}
#endif
 
Status
Not open for further replies.
Back
Top