Refactor some platform dependent logic (#13675)

This commit is contained in:
Joel Challis authored and GitHub committed 2021-07-24 19:56:45 +01:00
1 parent 145d89ab91
commit b5bcd5b0a1
11 files changed
+65 -46

No files matched your search

-5
View File
@@ -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)