[M] Split macros
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user