Index

auto-plow / ec2dcee

A wheelchair motor-propelled battery-powered ESP32-driven remote control snow plow.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
508 Nov 2019 19:26ec2dceeRadio Receiver and Other UpdatesJosh Stockin1190N

Blob @ auto-plow / main / util.c

text/plain352 bytesdownload raw
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
10int ticks_to_ms(int ticks) {
11 return (int)(ticks * portTICK_PERIOD_MS);
12}
13int ms_to_ticks(int ms) {
14 return (int)(ms / portTICK_PERIOD_MS);
15}
16
17void delay(int ms) {
18 vTaskDelay(ms_to_ticks(ms));
19}
20