mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 15:20:16 +00:00
24 lines
406 B
C
24 lines
406 B
C
/*
|
|
* SimpleTimer.h
|
|
*
|
|
* Created on: Aug 24, 2024
|
|
* Author: DashyFox
|
|
*/
|
|
|
|
#ifndef INC_SIMPLETIMER_H_
|
|
#define INC_SIMPLETIMER_H_
|
|
|
|
#include "stm32f1xx_hal.h"
|
|
|
|
#define forTimer(name, time) \
|
|
static uint32_t name##_previousMillis = 0; \
|
|
if (millis() - name##_previousMillis >= time)
|
|
|
|
#define resetForTimer(name) \
|
|
name##_previousMillis = millis();
|
|
|
|
uint32_t millis();
|
|
|
|
|
|
#endif /* INC_SIMPLETIMER_H_ */
|