[riot-notifications] [RIOT-OS/RIOT] periph/timer: add timer_set_periodic() (#13902)

Marian Buschsieweke notifications at github.com
Thu May 28 15:47:12 CEST 2020


@maribu commented on this pull request.

See inline. Feel free to squash right away.

> +        return "OK";
+    }
+
+    if (chan > 0 && count[chan] == 0) {
+        return "OK";
+    }
+
+    *succeeded = false;
+    return "ERROR";
+}
+
+int main(void)
+{
+    mutex_t lock = MUTEX_INIT_LOCKED;
+    const unsigned long timer_hz = XTIMER_HZ;
+    const unsigned steps = (CYCLE_MS * timer_hz) / 1000; /* 250 ms */

```suggestion
    const unsigned steps = (CYCLE_MS * timer_hz) / 1000;
```

> +    assert (end - start) > 5
+    assert (end - start) < 6

Needs to be updated to new value of CYCLE_MS. Maybe it makes sense to add a comment here, in case CYCLE_MS is ever touched again?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13902#pullrequestreview-420120370
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200528/98b567b3/attachment.htm>


More information about the notifications mailing list