158158 endif
159159endif
160160
161- CFLAGS += $(INC ) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS ) $(CFLAGS_MOD ) $(COPT )
161+ CFLAGS += $(INC ) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS ) $(CFLAGS_MOD ) $(COPT ) -Werror=missing-prototypes
162162
163163ifeq ($(CHIP_FAMILY ) , samd21)
164164CFLAGS += \
@@ -291,19 +291,9 @@ $(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align -Wno
291291endif
292292
293293SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY ) /, $(SRC_ASF ) )
294+ $(patsubst $(SRC_ASF ) ,% .c,% .o) : CFLAGS += -Wno-missing-prototypes
294295
295- SRC_C += \
296- audio_dma.c \
297- background.c \
298- bindings/samd/Clock.c \
299- bindings/samd/__init__.c \
300- boards/$(BOARD ) /board.c \
301- boards/$(BOARD ) /pins.c \
302- eic_handler.c \
303- fatfs_port.c \
304- freetouch/adafruit_ptc.c \
305- lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \
306- mphalport.c \
296+ SRC_PERIPHERALS := \
307297 peripherals/samd/$(PERIPHERALS_CHIP_FAMILY ) /adc.c \
308298 peripherals/samd/$(PERIPHERALS_CHIP_FAMILY ) /cache.c \
309299 peripherals/samd/$(PERIPHERALS_CHIP_FAMILY ) /clocks.c \
@@ -319,8 +309,24 @@ SRC_C += \
319309 peripherals/samd/external_interrupts.c \
320310 peripherals/samd/sercom.c \
321311 peripherals/samd/timers.c \
312+
313+ $(patsubst $(SRC_PERIPHERALS ) ,% .c,% .o) : CFLAGS += -Wno-missing-prototypes
314+
315+ SRC_C += \
316+ audio_dma.c \
317+ background.c \
318+ bindings/samd/Clock.c \
319+ bindings/samd/__init__.c \
320+ boards/$(BOARD ) /board.c \
321+ boards/$(BOARD ) /pins.c \
322+ eic_handler.c \
323+ fatfs_port.c \
324+ freetouch/adafruit_ptc.c \
325+ lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \
326+ mphalport.c \
322327 reset.c \
323328 timer_handler.c \
329+ $(SRC_PERIPHERALS ) \
324330
325331# This is an OR because it filters to any 1s and then checks to see if it is not
326332# empty.
0 commit comments