SP8EBC-ParaTNC/include/delay.h

32 wiersze
565 B
C
Czysty Zwykły widok Historia

2019-01-26 17:02:19 +00:00
/*
* delay.h
*
* Created on: 26.01.2019
* Author: mateusz
*/
#ifndef DELAY_H_
#define DELAY_H_
2019-01-26 22:18:25 +00:00
#include "stdint.h"
2019-01-27 11:34:43 +00:00
#include "main.h"
2019-01-26 22:18:25 +00:00
2022-05-14 19:49:48 +00:00
extern volatile int32_t delay_cnt;
2019-01-26 17:02:19 +00:00
void delay_set(uint16_t delay_in_msecs, uint8_t randomize);
2022-05-14 19:49:48 +00:00
void delay_fixed(int32_t delay_in_msecs);
uint32_t delay_fixed_with_count(int32_t delay_in_msecs);
2019-01-26 17:02:19 +00:00
void delay_from_preset(void);
void delay_random(void);
2022-05-14 19:49:48 +00:00
void delay_stop();
void delay_start();
2019-01-26 17:02:19 +00:00
inline void delay_decrement_counter(void) {
if (delay_cnt > 0)
2019-01-27 11:34:43 +00:00
delay_cnt -= SYSTICK_TICKS_PERIOD;
2019-01-26 17:02:19 +00:00
}
#endif /* DELAY_H_ */