1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

tests/periph_rtt: be more verbose on error

If `rtt_get_alarm()` doesn't return the correct value, print expected
and return value to ease debugging.
This commit is contained in:
Marian Buschsieweke 2021-03-30 14:48:03 +02:00
parent 3e32d55c33
commit 49a5bfb9e5
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -93,8 +93,10 @@ int main(void)
printf("Setting initial alarm to now + 5 s (%" PRIu32 ")\n", last);
rtt_set_alarm(last, cb, 0);
if (rtt_get_alarm() != last) {
puts("Error: rtt_get_alarm() not working");
uint32_t tmp = rtt_get_alarm();
if (tmp != last) {
printf("Error: rtt_get_alarm() not working (expected %" PRIu32 " but got %" PRIu32 ")\n",
last, tmp);
return 1;
}
else {