Browse Source

Fix ADC config

main
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

@@ -208,13 +208,13 @@ FLASHMEM void analog_init(void)
}
#endif
//ADC1
ADC1_CFG = mode | ADC_HC_AIEN | ADC_CFG_ADHSC;
ADC1_CFG = mode | ADC_CFG_ADHSC;
ADC1_GC = avg | ADC_GC_CAL; // begin cal
calibrating = 1;
while (ADC1_GC & ADC_GC_CAL) ;
calibrating = 0;
//ADC2
ADC2_CFG = mode | ADC_HC_AIEN | ADC_CFG_ADHSC;
ADC2_CFG = mode | ADC_CFG_ADHSC;
ADC2_GC = avg | ADC_GC_CAL; // begin cal
calibrating = 1;
while (ADC2_GC & ADC_GC_CAL) ;

Loading…
Cancel
Save