From b5bdfd98558c5fb39646484787a345f1651a4be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Thu, 27 Feb 2020 12:59:33 +0100 Subject: [PATCH] Rakefile: include USB PD library --- Rakefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index bb4d17d..e0a15d1 100644 --- a/Rakefile +++ b/Rakefile @@ -27,6 +27,9 @@ STM32F1_LIB = "opencm3_stm32f1" # source code used by the firmware SRC_DIRS = [".", "lib"] +# additional include libraries +INC_DIRS = ["usb_pd"] + # cross-compiler environment PREFIX = ENV["PREFIX"] || "arm-none-eabi" CC = PREFIX+"-gcc" @@ -44,8 +47,8 @@ cflags = [ENV["CFLAGS"]] cflags << "-Os" # add debug symbols (remove for smaller release) cflags << "-ggdb" -# use C99 (supported by most an sufficient) -cflags << "-std=c99" +# C11 is required by the USB PD library for anonymous structs +cflags << "-std=c11" # have strict warning (for better code) cflags << "-Wpedantic -Wall -Werror -Wundef -Wextra -Wshadow -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -Wstrict-overflow=5" # add options for better code optimization @@ -56,6 +59,8 @@ cflags << "-fshort-enums" cflags << "-ffreestanding" # include own libraries cflags += SRC_DIRS.collect {|srd_dir| "-I #{srd_dir}"} +# additional includes +cflags += INC_DIRS.collect {|inc_dir| "-I #{inc_dir}"} # include libopencm3 library cflags << "-I #{LIBOPENCM3_INC}" # add defines for micro-controller and board