Macros initial

This commit is contained in:
Alex Voinea 2020-09-11 16:12:49 +03:00
parent 160af0a624
commit eb007c35d2
No known key found for this signature in database
GPG key ID: F5034E7CFCF2F973
8 changed files with 35 additions and 32 deletions
Firmware

18
Firmware/macros.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef MACROS_H
#define MACROS_H
#define FORCE_INLINE __attribute__((always_inline)) inline
#define _UNUSED __attribute__((unused))
#ifndef CRITICAL_SECTION_START
#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
#define CRITICAL_SECTION_END SREG = _sreg;
#endif //CRITICAL_SECTION_START
// Macros to make a string from a macro
#define STRINGIFY_(M) #M
#define STRINGIFY(M) STRINGIFY_(M)
#endif //MACROS_H