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

Thread: Teensy 4.1 ADC.h will not compile

  1. #1
    Junior Member
    Join Date
    Oct 2017
    Posts
    9

    Teensy 4.1 ADC.h will not compile

    - Upgraded to Teensy 4.1.
    - Updated Teensyduino to latest version
    - IMU, light sensors, LEDs all work great.

    I need to use ADC.h for the temperature sensors, but the header will not compile. The following code snippet produces an error in ADC.h

    According to the system timestamp, ADC.h was updated same time as Teensyduino.

    #include <SPI.h>
    #include <SD.h>
    //#include <sdh.h> // external temp sensor
    #include <ADC.h> // offending line
    #include <mpu9250B.h>
    #include <stdio.h>

    error:
    D:\Programs\Arduino\hardware\teensy\avr\libraries\ ADC\RingBufferDMA.cpp: In constructor 'RingBufferDMA::RingBufferDMA(volatile int16_t*, uint32_t, uint8_t)':

    D:\Programs\Arduino\hardware\teensy\avr\libraries\ ADC\RingBufferDMA.cpp:33:19: error: 'ADC0_RA' was not declared in this scope

    , ADC_RA(&ADC0_RA + (uint32_t)0x20000*ADC_number)

    ^

    D:\Programs\Arduino\hardware\teensy\avr\libraries\ ADC\RingBufferDMA.cpp: In member function 'void RingBufferDMA::start(void (*)())':

    D:\Programs\Arduino\hardware\teensy\avr\libraries\ ADC\RingBufferDMA.cpp:64:30: error: 'DMAMUX_SOURCE_ADC0' was not declared in this scope

    uint8_t DMAMUX_SOURCE_ADC = DMAMUX_SOURCE_ADC0;

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,406
    What version of Teensyduino do you have installed? I assume a recent version as to have support for a 4.1.

    If you don't have the released version you might try updating to it to see if it helps. Or if not you might see if the version that @pedvide (the owner) has up on github builds correctly.

  3. #3
    Senior Member+
    Join Date
    Jul 2013
    Posts
    292
    The latest version on github works with Teensy 4.1.

  4. #4
    Junior Member
    Join Date
    Oct 2017
    Posts
    9
    Thanks guys. Cant say I pinpointed the problem, but updated Arduino from 1.8.5 to 1.8.12, and ADC works fine now.

Posting Permissions

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