altos/chaoskey: Delay ADC reading for 250ms at startup
authorKeith Packard <keithp@keithp.com>
Thu, 28 Jan 2016 21:58:43 +0000 (13:58 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 28 Jan 2016 21:58:43 +0000 (13:58 -0800)
This lets the HV supply stabilize before we start sampling values.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_trng_send.c

index 64c016b2da6949cf72333f29345b0dd47b84d48e..99994900aadbc3d1f8b7d2c174967fd21a2ef3f6 100644 (file)
@@ -72,6 +72,11 @@ ao_trng_send(void)
 
        ao_crc_reset();
 
 
        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);
        for (;;) {
                if (ao_send_raw()) {
                        ao_led_on(AO_LED_TRNG_RAW);