Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

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

  1. #1

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

    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" {
    extern uint16_t dma_channel_allocated_mask;
    #ifdef __cplusplus

    It used to work fine in the past, now I'm running Arduino 1.8.5 and Teensyduino 1.42. Thanks for any help!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    I tried it just now, using Arduino 1.8.7 and Teensyduino 1.44. Compiles without any error.

    Click image for larger version. 

Name:	sc.png 
Views:	32 
Size:	79.2 KB 
ID:	14750

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    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...

  4. #4
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts