DMAchannel.h won't compile in newer version of Arduino

Status
Not open for further replies.

Electric Potato

Well-known member
Hey all, I'm trying to run copyFromSD and I'm getting an error from DMAchannel.h:


C:\Program Files\Arduino\hardware\teensy\avr\cores\teensy3/DMAChannel.h:46:1: error: expected unqualified-id before 'extern'

extern "C" {

^

C:\Program Files\Arduino\hardware\teensy\avr\cores\teensy3/DMAChannel.h:46:1: error: expected constructor, destructor, or type conversion before 'extern'

Error compiling for board Teensy 3.2 / 3.1.


This is the line where it fails in DMAchannel.h:

#ifdef __cplusplus
extern "C" {
#endif
extern uint16_t dma_channel_allocated_mask;
#ifdef __cplusplus
}
#endif

It used to work fine in the past, now I'm running Arduino 1.8.5 and Teensyduino 1.42. Thanks for any help!
 
I tried it just now, using Arduino 1.8.7 and Teensyduino 1.44. Compiles without any error.

sc.png
 
Which program is this?

What is before this include file? Maybe something wrong with it...

As always I would suggest maybe installing 1.8.7 with new beta and see if that resolves it...
 
Thanks for the responses guys! I figured out the problem, it was silly. I had this malformed comment line at the very top of the page before the include statements :

***//dont forget to open the serial monitor or this wont run

so literally the first thing in my program was an error, nice.
 
Status
Not open for further replies.
Back
Top