<p></p>
<p><b>@benpicco</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16682#discussion_r676958044">drivers/rtt_rtc/rtt_rtc.c</a>:</p>
<pre style='color:#555'>> +    rtc_now      = s;
+    rtt_set_counter(now);
+    /* calculate next wake-up period */
+    _update_alarm(0);
+}
+
+void rtc_gettimeofday(uint32_t *s, uint32_t *us)
+{
+    uint32_t prev = rtc_now;
+
+    /* repeat calculation if an alarm triggered in between */
+    do {
+        uint32_t now = rtt_get_counter();
+        *s  = _rtc_now(now);
+        *us = ((uint64_t)SUBSECONDS(now - last_alarm) * US_PER_SEC) / RTT_SECOND;
+    } while (prev != rtc_now);
</pre>
<p>Huh good catch! This had slipped in earlier for <code>rtc_get_time()</code> as well.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/16682#discussion_r676958044">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYDW2GAIFBPXCGUYLTLTZXHXPANCNFSM5BAIVSLA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYCMSU6DBIK43WCN37LTZXHXPA5CNFSM5BAIVSLKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFKRJY6A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/16682#discussion_r676958044",
"url": "https://github.com/RIOT-OS/RIOT/pull/16682#discussion_r676958044",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>