mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-06-28 05:09:32 +00:00
IR_CMD_Handler
This commit is contained in:
23
Core/Inc/SimpleTimer.h
Normal file
23
Core/Inc/SimpleTimer.h
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_ */
|
Reference in New Issue
Block a user