Browse Source

Fix ADC config

teensy4-core
PaulStoffregen 4 years ago
parent
commit
e93972e151
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      teensy4/analog.c

+ 2
- 2
teensy4/analog.c View File

} }
#endif #endif
//ADC1 //ADC1
ADC1_CFG = mode | ADC_HC_AIEN | ADC_CFG_ADHSC;
ADC1_CFG = mode | ADC_CFG_ADHSC;
ADC1_GC = avg | ADC_GC_CAL; // begin cal ADC1_GC = avg | ADC_GC_CAL; // begin cal
calibrating = 1; calibrating = 1;
while (ADC1_GC & ADC_GC_CAL) ; while (ADC1_GC & ADC_GC_CAL) ;
calibrating = 0; calibrating = 0;
//ADC2 //ADC2
ADC2_CFG = mode | ADC_HC_AIEN | ADC_CFG_ADHSC;
ADC2_CFG = mode | ADC_CFG_ADHSC;
ADC2_GC = avg | ADC_GC_CAL; // begin cal ADC2_GC = avg | ADC_GC_CAL; // begin cal
calibrating = 1; calibrating = 1;
while (ADC2_GC & ADC_GC_CAL) ; while (ADC2_GC & ADC_GC_CAL) ;

Loading…
Cancel
Save