From 8ad3b7a11d3c57f53e42b38c2e98b3ac2caf746a Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Sat, 28 Dec 2024 19:34:38 -0600 Subject: [PATCH] serial_protocol remove constexpr --- serial_protocol.hpp | 24 ++++++++++++------------ tools/Makefile | 7 ++++--- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/serial_protocol.hpp b/serial_protocol.hpp index 4352ed5..0b7f99f 100644 --- a/serial_protocol.hpp +++ b/serial_protocol.hpp @@ -41,7 +41,7 @@ static inline uint32_t le_bswap(const uint32_t n) return __builtin_bswap32(n); } -constexpr union command_reply command_reply(uint32_t cmd, uint32_t arg0, uint32_t arg1) +union command_reply command_reply(uint32_t cmd, uint32_t arg0, uint32_t arg1) { union command_reply command = { .cmd = le_bswap(cmd), @@ -67,27 +67,27 @@ namespace command { static_assert(_maple_raw == 0xb62422e0); - constexpr union command_reply write(uint32_t dest, uint32_t size) + union command_reply write(uint32_t dest, uint32_t size) { return command_reply(_write, dest, size); } - constexpr union command_reply read(uint32_t dest, uint32_t size) + union command_reply read(uint32_t dest, uint32_t size) { return command_reply(_read, dest, size); } - constexpr union command_reply jump(uint32_t dest) + union command_reply jump(uint32_t dest) { return command_reply(_jump, dest, 0); } - constexpr union command_reply speed(uint32_t speed) + union command_reply speed(uint32_t speed) { return command_reply(_speed, speed, 0); } - constexpr union command_reply maple_raw(uint32_t send_size, uint32_t recv_size) + union command_reply maple_raw(uint32_t send_size, uint32_t recv_size) { return command_reply(_maple_raw, send_size, recv_size); } @@ -112,32 +112,32 @@ namespace reply { static_assert(_crc == 0xcc9aab7c); - constexpr union command_reply write(uint32_t dest, uint32_t size) + union command_reply write(uint32_t dest, uint32_t size) { return command_reply(_write, dest, size); } - constexpr union command_reply read(uint32_t dest, uint32_t size) + union command_reply read(uint32_t dest, uint32_t size) { return command_reply(_read, dest, size); } - constexpr union command_reply jump(uint32_t dest) + union command_reply jump(uint32_t dest) { return command_reply(_jump, dest, 0); } - constexpr union command_reply speed(uint32_t speed) + union command_reply speed(uint32_t speed) { return command_reply(_speed, speed, 0); } - constexpr union command_reply crc(uint32_t crc) + union command_reply crc(uint32_t crc) { return command_reply(_crc, crc, 0); } - constexpr union command_reply maple_raw(uint32_t send_size, uint32_t recv_size) + union command_reply maple_raw(uint32_t send_size, uint32_t recv_size) { return command_reply(_maple_raw, send_size, recv_size); } diff --git a/tools/Makefile b/tools/Makefile index 135e951..6014392 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -2,18 +2,19 @@ CFLAGS = -Og -g -gdwarf-4 -Wall -Wextra -Werror -Wfatal-errors -ggdb -fstack-pro CFLAGS += -Wno-error=unused-parameter CFLAGS += -Wno-error=unused-variable CFLAGS += -Wno-error=unused-but-set-variable +CFLAGS += -Wno-vla-cxx-extension CXXFLAGS = -std=c++23 FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2) FREETYPE_LDFLAGS = $(shell pkg-config --libs freetype2) -FTDI_CFLAGS = $(shell pkg-config --cflags libftdi1) -I.. +FTDI_CFLAGS = $(shell pkg-config --cflags libftdi1) -I. FTDI_LDFLAGS = $(shell pkg-config --libs libftdi1) all: ttf_outline -crc32.o: ../crc32.c - $(CC) -std=gnu2x $(CFLAGS) -I.. -c $< -o $@ +crc32.o: crc32.c + $(CC) -std=gnu2x $(CFLAGS) -I. -c $< -o $@ ttf_%.o: ttf_%.cpp $(CXX) $(CFLAGS) $(CXXFLAGS) $(FREETYPE_CFLAGS) -c $< -o $@