Bläddra i källkod

Fix compiler warnings

teensy4-core
PaulStoffregen 5 år sedan
förälder
incheckning
fb0fcaa8b7
1 ändrade filer med 2 tillägg och 3 borttagningar
  1. +2
    -3
      teensy4/analog.c

+ 2
- 3
teensy4/analog.c Visa fil



void analogReadAveraging(unsigned int num) void analogReadAveraging(unsigned int num)
{ {
uint32_t tmp32, mode, avg=0;
uint32_t mode;
//disable averaging //disable averaging
tmp32 = ADC1_GC;
ADC1_GC &= ~0x20; ADC1_GC &= ~0x20;
mode = ADC1_CFG & ~0xC000; mode = ADC1_CFG & ~0xC000;


ADC1_CFG |= mode; ADC1_CFG |= mode;


if(num >= 4) if(num >= 4)
ADC1_GC |= ADC_GC_AVGE;// turns on averaging}
ADC1_GC |= ADC_GC_AVGE;// turns on averaging
} }


#define MAX_ADC_CLOCK 20000000 #define MAX_ADC_CLOCK 20000000

Laddar…
Avbryt
Spara