Teensy 4.1 ADC.h will not compile

Status
Not open for further replies.

caliope

Member
- 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;
 
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.
 
Thanks guys. Cant say I pinpointed the problem, but updated Arduino from 1.8.5 to 1.8.12, and ADC works fine now.
 
Status
Not open for further replies.
Back
Top