summaryrefslogtreecommitdiffstats
path: root/movement
diff options
context:
space:
mode:
authorAlex Maestas <git@se30.xyz>2023-12-17 17:39:59 +0000
committerAlex Maestas <git@se30.xyz>2023-12-17 17:39:59 +0000
commit89e86fe6294948df0ca8aade93e9893f317dd5fc (patch)
tree0e9b3456e9421faaf7bccf7243f2ec06603943eb /movement
parent63d6bc6aa0ddf4cc1ce1918ef7650852a25e581b (diff)
downloadSensor-Watch-89e86fe6294948df0ca8aade93e9893f317dd5fc.tar.gz
Sensor-Watch-89e86fe6294948df0ca8aade93e9893f317dd5fc.tar.bz2
Sensor-Watch-89e86fe6294948df0ca8aade93e9893f317dd5fc.zip
work around silicon erratum in TRNG
Diffstat (limited to 'movement')
-rw-r--r--movement/watch_faces/complication/randonaut_face.c2
-rw-r--r--movement/watch_faces/complication/toss_up_face.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/movement/watch_faces/complication/randonaut_face.c b/movement/watch_faces/complication/randonaut_face.c
index bca334fb..886aabb7 100644
--- a/movement/watch_faces/complication/randonaut_face.c
+++ b/movement/watch_faces/complication/randonaut_face.c
@@ -357,7 +357,7 @@ static uint32_t _get_true_entropy(void) {
while (!hri_trng_get_INTFLAG_reg(TRNG, TRNG_INTFLAG_DATARDY)); // Wait for TRNG data to be ready
- hri_trng_clear_CTRLA_ENABLE_bit(TRNG);
+ watch_disable_TRNG(TRNG);
hri_mclk_clear_APBCMASK_TRNG_bit(MCLK);
return hri_trng_read_DATA_reg(TRNG); // Read a single 32-bit word from TRNG and return it
#endif
diff --git a/movement/watch_faces/complication/toss_up_face.c b/movement/watch_faces/complication/toss_up_face.c
index 08dd0052..dedc9042 100644
--- a/movement/watch_faces/complication/toss_up_face.c
+++ b/movement/watch_faces/complication/toss_up_face.c
@@ -255,7 +255,8 @@ uint32_t get_true_entropy(void) {
while (!hri_trng_get_INTFLAG_reg(TRNG, TRNG_INTFLAG_DATARDY)); // Wait for TRNG data to be ready
- hri_trng_clear_CTRLA_ENABLE_bit(TRNG);
+ watch_disable_TRNG(TRNG);
+
hri_mclk_clear_APBCMASK_TRNG_bit(MCLK);
return hri_trng_read_DATA_reg(TRNG); // Read a single 32-bit word from TRNG and return it
#endif