From 35407e664886bed21dcef7764843aac03be8490c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 28 Jan 2016 13:58:43 -0800 Subject: [PATCH] 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 --- src/drivers/ao_trng_send.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.30.2