Skip to content

Commit

Permalink
Fix usb.c and usb_queue.c warnings in our CMakeLists instead of in th…
Browse files Browse the repository at this point in the history
…e files (#2423)
  • Loading branch information
gullradriel authored Dec 14, 2024
1 parent 5075349 commit b38d101
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions firmware/application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ include(external/external.cmake)
# Define linker script file here
set(LDSCRIPT ${PORTLD}/LPC43xx_M0.ld)

# Special case for these two files:
# Originally these are compiled for M4 support, but in Mayhem we use them with M0
# As a result they are generating a lot of noise warnings
# Since they are not really using the defines stated in the warnings
# Since the only used one (NVIC_USB0_IRQ) is having the same value in both M0 and M4 mode
# => We are faking M4 mode on them
set(NO_WARNINGS_USBFILES
${HACKRF_PATH}/firmware/common/usb.c
${HACKRF_PATH}/firmware/common/usb_queue.c
)

# -DLPC43XX_M4 kills the 'warning: "NVIC_XXXX..." redefined'
# -D__ARM_ARCH_7M__ kills the 'warning: implicit declaration of function __ldrex && __sdrex'
set_source_files_properties(${NO_WARNINGS_USBFILES} PROPERTIES COMPILE_FLAGS "-DLPC43XX_M4 -D__ARM_ARCH_7M__")

# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
set(CSRC
Expand All @@ -118,8 +133,7 @@ set(CSRC
usb_serial_endpoints.c
usb_serial_device_to_host.c
i2c_device_to_host.c
${HACKRF_PATH}/firmware/common/usb.c
${HACKRF_PATH}/firmware/common/usb_queue.c
${NO_WARNINGS_USBFILES}
${HACKRF_PATH}/firmware/hackrf_usb/usb_device.c
${HACKRF_PATH}/firmware/common/usb_request.c
${HACKRF_PATH}/firmware/common/usb_standard_request.c
Expand Down

0 comments on commit b38d101

Please sign in to comment.