Rakefile: include USB PD library

This commit is contained in:
King Kévin 2020-02-27 12:59:33 +01:00
parent 83432a483e
commit b5bdfd9855
1 changed files with 7 additions and 2 deletions

View File

@ -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