forked from mirrors/qmk_userspace
Refactor some platform dependent logic (#13675)
This commit is contained in:
parent
145d89ab91
commit
b5bcd5b0a1
11 changed files with 65 additions and 46 deletions
|
@ -18,11 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if defined(__AVR__)
|
||||
# include "avr/timer_avr.h"
|
||||
#endif
|
||||
|
||||
#define TIMER_DIFF(a, b, max) ((max == UINT8_MAX) ? ((uint8_t)((a) - (b))) : ((max == UINT16_MAX) ? ((uint16_t)((a) - (b))) : ((max == UINT32_MAX) ? ((uint32_t)((a) - (b))) : ((a) >= (b) ? (a) - (b) : (max) + 1 - (b) + (a)))))
|
||||
#define TIMER_DIFF_8(a, b) TIMER_DIFF(a, b, UINT8_MAX)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue