aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/NRF5/LLD/hal_rng_lld.c
diff options
context:
space:
mode:
authorStephane D'Alu <sdalu@sdalu.com>2016-07-11 22:11:27 +0200
committerStephane D'Alu <sdalu@sdalu.com>2016-07-11 22:11:27 +0200
commit539338100fffb76e152be37228c4040fa072ba92 (patch)
treee73660bd3d81d691c64626c1ce36596664fb0f0a /os/hal/ports/NRF5/LLD/hal_rng_lld.c
parent52107b2ccbf1b5ed29123d77d5cd3bc982fdee2e (diff)
downloadChibiOS-Contrib-539338100fffb76e152be37228c4040fa072ba92.tar.gz
ChibiOS-Contrib-539338100fffb76e152be37228c4040fa072ba92.tar.bz2
ChibiOS-Contrib-539338100fffb76e152be37228c4040fa072ba92.zip
deal with write buffer
Diffstat (limited to 'os/hal/ports/NRF5/LLD/hal_rng_lld.c')
-rw-r--r--os/hal/ports/NRF5/LLD/hal_rng_lld.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/os/hal/ports/NRF5/LLD/hal_rng_lld.c b/os/hal/ports/NRF5/LLD/hal_rng_lld.c
index 5e85981..9712150 100644
--- a/os/hal/ports/NRF5/LLD/hal_rng_lld.c
+++ b/os/hal/ports/NRF5/LLD/hal_rng_lld.c
@@ -95,7 +95,10 @@ void rng_lld_start(RNGDriver *rngp) {
/* Clear pending events */
rng->EVENTS_VALRDY = 0;
-
+#if CORTEX_MODEL >= 4
+ (void)rng->EVENTS_VALRDY;
+#endif
+
/* Set interrupt mask */
rng->INTENSET = RNG_INTENSET_VALRDY_Msk;
@@ -151,7 +154,10 @@ msg_t rng_lld_write(RNGDriver *rngp, uint8_t *buf, size_t n,
/* Mark as read */
rng->EVENTS_VALRDY = 0;
-
+#if CORTEX_MODEL >= 4
+ (void)rng->EVENTS_VALRDY;
+#endif
+
/* Clear interrupt so we can wake up again */
nvicClearPending(rngp->irq);
}