[M] Split macros

This commit is contained in:
Hykilpikonna
2023-03-25 19:40:06 -04:00
parent 96474926e0
commit 4d975caf40
3 changed files with 16 additions and 8 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
project("untitled" C CXX)
project("firmware" C CXX)
include(CMakeListsPrivate.txt)
@@ -30,4 +30,4 @@ add_custom_target(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_executable(Z_DUMMY_TARGET ${SRC_LIST})
add_executable(Z_DUMMY_TARGET ${SRC_LIST} src/macros.h)
+13
View File
@@ -0,0 +1,13 @@
#ifndef FIRMWARE_MACROS_H
#define FIRMWARE_MACROS_H
#define u8 uint8_t
#define u16 uint16_t
#define u32 uint32_t
#define u64 uint64_t
#define timeMillis() std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count()
#define min(a, b) ((a) < (b) ? (a) : (b))
#define let auto
#define val const auto
#endif //FIRMWARE_MACROS_H
+1 -6
View File
@@ -1,13 +1,8 @@
#include <Arduino.h>
#include <chrono>
#include <cinttypes>
#include "macros.h"
#define u8 uint8_t
#define u16 uint16_t
#define u32 uint32_t
#define u64 uint64_t
#define timeMillis() std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count()
#define min(a, b) ((a) < (b) ? (a) : (b))
u64 start_time = 0;