Skip to content

Commit

Permalink
Fix compilation on AVR
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Feb 18, 2020
1 parent ff9f3fe commit f7453df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ clean:
COMMON_DIR=src/common
SRC=$(wildcard $(COMMON_DIR)/*.c)
INCLUDE=$(wildcard $(COMMON_DIR)/include/common/*.h) $(COMMON_DIR)/common.mk
CFLAGS=-I$(COMMON_DIR)/include -D__VERSION__=$(VERSION)
CFLAGS=-I$(COMMON_DIR)/include -D__FIRMWARE_VERSION__=$(VERSION)
include $(COMMON_DIR)/common.mk

# Include the board's source
Expand Down
7 changes: 6 additions & 1 deletion src/common/version.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#include <common/macro.h>

// Prevent failures to compile on AVR
#ifndef __SDCC
#define __code
#endif

static const char __code BOARD[] =
"76EC_BOARD="
xstr(__BOARD__);

static const char __code VERSION[] =
"76EC_VERSION="
xstr(__VERSION__);
xstr(__FIRMWARE_VERSION__);

const char * board() {
return &BOARD[11];
Expand Down

0 comments on commit f7453df

Please sign in to comment.