aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-adc.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-08-06 21:27:45 -0600
committerSelene ToyKeeper2018-08-06 21:27:45 -0600
commitce2397cbe9ffd2e5f046f4a51a30becbce3b2fc4 (patch)
treeab5b14203adad80505368f31f8dfa6a87a1cb356 /spaghetti-monster/fsm-adc.c
parentMade it easier to change ramp shape in bin/level_calc.py . (diff)
parentAdded more driver types to Anduril. (diff)
downloadanduril-ce2397cbe9ffd2e5f046f4a51a30becbce3b2fc4.tar.gz
anduril-ce2397cbe9ffd2e5f046f4a51a30becbce3b2fc4.tar.bz2
anduril-ce2397cbe9ffd2e5f046f4a51a30becbce3b2fc4.zip
merged updates from fsm branch, including RampingIOS V3 and Werner UIs...
... plus a bunch of other updates, fixes, improvements, etc.
Diffstat (limited to 'spaghetti-monster/fsm-adc.c')
-rw-r--r--spaghetti-monster/fsm-adc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c
index 6e9f19b..2ec630c 100644
--- a/spaghetti-monster/fsm-adc.c
+++ b/spaghetti-monster/fsm-adc.c
@@ -109,6 +109,11 @@ ISR(ADC_vect) {
uint16_t measurement = ADC; // latest 10-bit ADC reading
+ #ifdef USE_PSEUDO_RAND
+ // real-world entropy makes this a true random, not pseudo
+ pseudo_rand_seed += measurement;
+ #endif
+
adc_step = (adc_step + 1) & (ADC_STEPS-1);
#ifdef USE_LVP