diff --git a/firmware/CMakeLists.txt b/firmware/CMakeLists.txt index e241a23..c1774c2 100644 --- a/firmware/CMakeLists.txt +++ b/firmware/CMakeLists.txt @@ -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) diff --git a/firmware/src/macros.h b/firmware/src/macros.h new file mode 100644 index 0000000..d6c728e --- /dev/null +++ b/firmware/src/macros.h @@ -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::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 diff --git a/firmware/src/main.cpp b/firmware/src/main.cpp index d26b288..45576a5 100644 --- a/firmware/src/main.cpp +++ b/firmware/src/main.cpp @@ -1,13 +1,8 @@ #include #include #include +#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::system_clock::now().time_since_epoch()).count() -#define min(a, b) ((a) < (b) ? (a) : (b)) u64 start_time = 0;