summaryrefslogtreecommitdiff
path: root/src/drivers/ao_trng_send.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-01-28 13:58:43 -0800
committerKeith Packard <keithp@keithp.com>2016-01-28 13:58:43 -0800
commit35407e664886bed21dcef7764843aac03be8490c (patch)
treeccf0fc121987f3dc0f0ddfe3244f8a7a24e09ba8 /src/drivers/ao_trng_send.c
parentf2d3202de9a5847923f72afe2969eb7ccd7342c7 (diff)
altos/chaoskey: Delay ADC reading for 250ms at startup
This lets the HV supply stabilize before we start sampling values. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_trng_send.c')
-rw-r--r--src/drivers/ao_trng_send.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/ao_trng_send.c b/src/drivers/ao_trng_send.c
index 64c016b2..99994900 100644
--- a/src/drivers/ao_trng_send.c
+++ b/src/drivers/ao_trng_send.c
@@ -72,6 +72,11 @@ ao_trng_send(void)
ao_crc_reset();
+ /* Delay long enough for the HV power supply to stabilize so that the
+ * first bits we read aren't of poor quality
+ */
+ ao_delay(AO_MS_TO_TICKS(250));
+
for (;;) {
if (ao_send_raw()) {
ao_led_on(AO_LED_TRNG_RAW);