A wheelchair motor-propelled battery-powered ESP32-driven remote control snow plow.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
5 | 08 Nov 2019 19:26 | ec2dcee | Radio Receiver and Other Updates | Josh Stockin | 1 | 19 | 0 | N |
1 | // util.c |
2 | // Basic utilities |
3 | // Copyright (c) Joshua 'joshuas3' Stockin 2019 |
4 | |
5 | #include "util.h" |
6 | |
7 | #include "freertos/FreeRTOS.h" |
8 | #include "freertos/task.h" |
9 | |
10 | int ticks_to_ms(int ticks) { |
11 | return (int)(ticks * portTICK_PERIOD_MS); |
12 | } |
13 | int ms_to_ticks(int ms) { |
14 | return (int)(ms / portTICK_PERIOD_MS); |
15 | } |
16 | |
17 | void delay(int ms) { |
18 | vTaskDelay(ms_to_ticks(ms)); |
19 | } |
20 |