diff --git a/SConscript b/SConscript index f617410b434..457ef273d13 100644 --- a/SConscript +++ b/SConscript @@ -83,6 +83,8 @@ def build_project(project_name, project, extra_flags): '.', '..', panda_root, + f"{panda_root}/include/", + f"{panda_root}/include/board/", f"{panda_root}/board/", f"{panda_root}/../opendbc/safety/", ] diff --git a/board/bootstub.c b/board/bootstub.c index 5e05fa66d7d..7fdbc961cc7 100644 --- a/board/bootstub.c +++ b/board/bootstub.c @@ -4,7 +4,8 @@ #define MIN_VERSION 2 // ********************* Includes ********************* -#include "config.h" +#include "board_config.h" +#include "stm_config.h" #include "drivers/led.h" #include "drivers/pwm.h" diff --git a/board/comms_definitions.h b/board/comms_definitions.h index 18a6d2f8134..3fe236b0282 100644 --- a/board/comms_definitions.h +++ b/board/comms_definitions.h @@ -1,3 +1,4 @@ +#pragma once typedef struct { uint8_t request; uint16_t param1; diff --git a/board/critical.h b/board/critical.h index ae2d5c0a699..dfd52287fa2 100644 --- a/board/critical.h +++ b/board/critical.h @@ -3,7 +3,7 @@ // ********************* Critical section helpers ********************* uint8_t global_critical_depth = 0U; -static volatile bool interrupts_enabled = false; +volatile bool interrupts_enabled = false; void enable_interrupts(void) { interrupts_enabled = true; diff --git a/board/critical_declarations.h b/board/critical_declarations.h index 42211d46c38..9a7d99317b3 100644 --- a/board/critical_declarations.h +++ b/board/critical_declarations.h @@ -5,6 +5,7 @@ void enable_interrupts(void); void disable_interrupts(void); extern uint8_t global_critical_depth; +extern volatile bool interrupts_enabled; #define ENTER_CRITICAL() \ __disable_irq(); \ diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index eeaf87384e8..7dc0f728f21 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -17,14 +17,6 @@ int can_silent = ALL_CAN_SILENT; bool can_loopback = false; // ********************* instantiate queues ********************* -#define can_buffer(x, size) \ - static CANPacket_t elems_##x[size]; \ - extern can_ring can_##x; \ - can_ring can_##x = { .w_ptr = 0, .r_ptr = 0, .fifo_size = (size), .elems = (CANPacket_t *)&(elems_##x) }; - -#define CAN_RX_BUFFER_SIZE 4096U -#define CAN_TX_BUFFER_SIZE 416U - #ifdef STM32H7 // ITCM RAM and DTCM RAM are the fastest for Cortex-M7 core access __attribute__((section(".axisram"))) can_buffer(rx_q, CAN_RX_BUFFER_SIZE) diff --git a/board/drivers/can_common_declarations.h b/board/drivers/can_common_declarations.h index 57bf87d9c7c..8d5ee87e3df 100644 --- a/board/drivers/can_common_declarations.h +++ b/board/drivers/can_common_declarations.h @@ -1,4 +1,9 @@ #pragma once +#include +#include +#include "can.h" +#include "health.h" +#include "safety.h" typedef struct { volatile uint32_t w_ptr; @@ -7,6 +12,18 @@ typedef struct { CANPacket_t *elems; } can_ring; +#define can_buffer(x, size) \ + static CANPacket_t elems_##x[size]; \ + can_ring can_##x = { .w_ptr = 0, .r_ptr = 0, .fifo_size = (size), .elems = (CANPacket_t *)&(elems_##x) }; + +#define CAN_RX_BUFFER_SIZE 4096U +#define CAN_TX_BUFFER_SIZE 416U + +extern can_ring can_rx_q; +extern can_ring can_tx1_q; +extern can_ring can_tx2_q; +extern can_ring can_tx3_q; + typedef struct { uint8_t bus_lookup; uint8_t can_num_lookup; @@ -75,14 +92,17 @@ extern bus_config_t bus_config[BUS_CONFIG_ARRAY_SIZE]; #define CAN_NUM_FROM_BUS_NUM(num) (bus_config[num].can_num_lookup) void can_init_all(void); +void can_clear(can_ring *q); void can_set_orientation(bool flipped); #ifdef PANDA_JUNGLE void can_set_forwarding(uint8_t from, uint8_t to); #endif void ignition_can_hook(CANPacket_t *to_push); bool can_tx_check_min_slots_free(uint32_t min); -uint8_t calculate_checksum(const uint8_t *dat, uint32_t len); -void can_set_checksum(CANPacket_t *packet); +extern uint8_t calculate_checksum(const uint8_t *dat, uint32_t len); +extern void can_set_checksum(CANPacket_t *packet); bool can_check_checksum(CANPacket_t *packet); void can_send(CANPacket_t *to_push, uint8_t bus_number, bool skip_tx_hook); bool is_speed_valid(uint32_t speed, const uint32_t *all_speeds, uint8_t len); + +extern bool safety_tx_hook(CANPacket_t *to_send); diff --git a/board/drivers/fan.h b/board/drivers/fan.h index ec0e1be5faf..29d82c59956 100644 --- a/board/drivers/fan.h +++ b/board/drivers/fan.h @@ -1,4 +1,5 @@ #include "fan_declarations.h" +#include "utils.h" struct fan_state_t fan_state; diff --git a/board/drivers/gpio.h b/board/drivers/gpio.h index 0b8fc091b1f..7d45c618274 100644 --- a/board/drivers/gpio.h +++ b/board/drivers/gpio.h @@ -1,19 +1,6 @@ -#define MODE_INPUT 0 -#define MODE_OUTPUT 1 -#define MODE_ALTERNATE 2 -#define MODE_ANALOG 3 - -#define PULL_NONE 0 -#define PULL_UP 1 -#define PULL_DOWN 2 - -#define OUTPUT_TYPE_PUSH_PULL 0U -#define OUTPUT_TYPE_OPEN_DRAIN 1U - -typedef struct { - GPIO_TypeDef * const bank; - uint8_t pin; -} gpio_t; +#include "drivers/gpio_declarations.h" +#include "critical_declarations.h" +#include "drivers/registers.h" void set_gpio_mode(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode) { ENTER_CRITICAL(); @@ -68,12 +55,14 @@ int get_gpio_input(const GPIO_TypeDef *GPIO, unsigned int pin) { return (GPIO->IDR & (1UL << pin)) == (1UL << pin); } +// cppcheck-suppress[misra-c2012-9.3,misra-c2012-8.7] void gpio_set_all_output(gpio_t *pins, uint8_t num_pins, bool enabled) { for (uint8_t i = 0; i < num_pins; i++) { set_gpio_output(pins[i].bank, pins[i].pin, enabled); } } +// cppcheck-suppress[misra-c2012-9.3,misra-c2012-8.7] void gpio_set_bitmask(gpio_t *pins, uint8_t num_pins, uint32_t bitmask) { for (uint8_t i = 0; i < num_pins; i++) { set_gpio_output(pins[i].bank, pins[i].pin, (bitmask >> i) & 1U); diff --git a/board/drivers/registers.h b/board/drivers/registers.h index 92b6b0faa29..5f25d1eaaef 100644 --- a/board/drivers/registers.h +++ b/board/drivers/registers.h @@ -1,4 +1,6 @@ +#pragma once #include "registers_declarations.h" +#include "critical_declarations.h" static reg register_map[REGISTER_MAP_SIZE]; diff --git a/board/faults.h b/board/faults.h index 0fc9d2c5cfb..09a9edf8efb 100644 --- a/board/faults.h +++ b/board/faults.h @@ -1,3 +1,4 @@ +#pragma once #include "faults_declarations.h" uint8_t fault_status = FAULT_STATUS_NONE; diff --git a/board/health.h b/board/health.h index 74d822dc6ce..a8074c1ae32 100644 --- a/board/health.h +++ b/board/health.h @@ -1,4 +1,5 @@ // When changing these structs, python/__init__.py needs to be kept up to date! +#pragma once #define HEALTH_PACKET_VERSION 16 struct __attribute__((packed)) health_t { diff --git a/board/jungle/main.c b/board/jungle/main.c index 1c73edd7ce9..7de25c9b2be 100644 --- a/board/jungle/main.c +++ b/board/jungle/main.c @@ -1,5 +1,6 @@ // ********************* Includes ********************* -#include "board/config.h" +#include "board_config.h" +#include "board/stm_config.h" #include "safety.h" diff --git a/board/libc.h b/board/libc.h index c5f02193509..50335658d1f 100644 --- a/board/libc.h +++ b/board/libc.h @@ -1,4 +1,5 @@ // **** libc **** +#pragma once void delay(uint32_t a) { volatile uint32_t i; diff --git a/board/main.c b/board/main.c index 9770f8368f8..358d25468c5 100644 --- a/board/main.c +++ b/board/main.c @@ -1,5 +1,6 @@ // ********************* Includes ********************* -#include "config.h" +#include "board_config.h" +#include "stm_config.h" #include "drivers/led.h" #include "drivers/pwm.h" diff --git a/board/main_declarations.h b/board/main_declarations.h index 2704a01a032..7b65279a77d 100644 --- a/board/main_declarations.h +++ b/board/main_declarations.h @@ -1,4 +1,5 @@ #pragma once +#include "platform_definitions.h" // ******************** Prototypes ******************** void print(const char *a); diff --git a/board/utils.h b/board/utils.h index f355ce8c2f2..2c92f7efca8 100644 --- a/board/utils.h +++ b/board/utils.h @@ -1,3 +1,6 @@ +#ifndef UTILS_DEFINITION_H +#define UTILS_DEFINITION_H +#include // cppcheck-suppress-macro misra-c2012-1.2; allow __typeof__ extension #define MIN(a, b) ({ \ __typeof__ (a) _a = (a); \ @@ -42,6 +45,7 @@ // compute the time elapsed (in microseconds) from 2 counter samples // case where ts < ts_last is ok: overflow is properly re-casted into uint32_t -uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) { +static inline uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) { return ts - ts_last; } +#endif //UTILS_DEFINITION_H diff --git a/board/config.h b/include/board/board_config.h similarity index 72% rename from board/config.h rename to include/board/board_config.h index 6fb95ada26f..3850159c55c 100644 --- a/board/config.h +++ b/include/board/board_config.h @@ -32,13 +32,8 @@ #endif #endif -// platform includes -#ifdef STM32H7 - #include "stm32h7/stm32h7_config.h" -#elif defined(STM32F4) - #include "stm32f4/stm32f4_config.h" +#ifndef BOOTSTUB + #include "main_definitions.h" #else - // TODO: uncomment this, cppcheck complains - // building for tests - //#include "fake_stm.h" + #include "bootstub_definitions.h" #endif diff --git a/board/bootstub_declarations.h b/include/board/bootstub_definitions.h similarity index 93% rename from board/bootstub_declarations.h rename to include/board/bootstub_definitions.h index 5cdec508e70..32aef4da887 100644 --- a/board/bootstub_declarations.h +++ b/include/board/bootstub_definitions.h @@ -1,3 +1,5 @@ +#include "platform_definitions.h" +#include "utils.h" // ******************** Prototypes ******************** void print(const char *a){ UNUSED(a); } void puth(uint8_t i){ UNUSED(i); } diff --git a/include/board/drivers/gpio_declarations.h b/include/board/drivers/gpio_declarations.h new file mode 100644 index 00000000000..0b4b78217a6 --- /dev/null +++ b/include/board/drivers/gpio_declarations.h @@ -0,0 +1,30 @@ +#pragma once +#include +#include "platform_definitions.h" + +#define MODE_INPUT 0 +#define MODE_OUTPUT 1 +#define MODE_ALTERNATE 2 +#define MODE_ANALOG 3 + +#define PULL_NONE 0 +#define PULL_UP 1 +#define PULL_DOWN 2 + +#define OUTPUT_TYPE_PUSH_PULL 0U +#define OUTPUT_TYPE_OPEN_DRAIN 1U + +typedef struct { + GPIO_TypeDef * const bank; + uint8_t pin; +} gpio_t; + +void set_gpio_mode(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode); +void set_gpio_output(GPIO_TypeDef *GPIO, unsigned int pin, bool enabled); +void set_gpio_output_type(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int output_type); +void set_gpio_alternate(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode); +void set_gpio_pullup(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode); +int get_gpio_input(const GPIO_TypeDef *GPIO, unsigned int pin); +void gpio_set_all_output(gpio_t *pins, uint8_t num_pins, bool enabled); +void gpio_set_bitmask(gpio_t *pins, uint8_t num_pins, uint32_t bitmask); +bool detect_with_pull(GPIO_TypeDef *GPIO, int pin, int mode); diff --git a/board/main_definitions.h b/include/board/main_definitions.h similarity index 96% rename from board/main_definitions.h rename to include/board/main_definitions.h index 137d987362c..03c3a096a1f 100644 --- a/board/main_definitions.h +++ b/include/board/main_definitions.h @@ -1,3 +1,4 @@ +#pragma once #include "main_declarations.h" // ********************* Globals ********************** diff --git a/include/board/platform_definitions.h b/include/board/platform_definitions.h new file mode 100644 index 00000000000..7a9c1054397 --- /dev/null +++ b/include/board/platform_definitions.h @@ -0,0 +1,15 @@ +/* Platform includes that provide definitions that a lot drivers need, e.g.: + __enable_irq + __disable_irq + GPIO_TypeDef + TIM_TypeDef + IRQn_Type + USART_TypeDef + CAN_TypeDef +*/ +#pragma once +#ifdef STM32H7 + #include "stm32h7/stm32h7_platform_definitions.h" +#elif defined(STM32F4) + #include "stm32f4/stm32f4_platform_definitions.h" +#endif diff --git a/board/stm32f4/stm32f4_config.h b/include/board/stm32f4/stm32f4_config.h similarity index 51% rename from board/stm32f4/stm32f4_config.h rename to include/board/stm32f4/stm32f4_config.h index ee2759a73c4..dc790a015be 100644 --- a/board/stm32f4/stm32f4_config.h +++ b/include/board/stm32f4/stm32f4_config.h @@ -1,44 +1,9 @@ #include "stm32f4/inc/stm32f4xx.h" #include "stm32f4/inc/stm32f4xx_hal_gpio_ex.h" -#define MCU_IDCODE 0x463U - -#define CORE_FREQ 96U // in MHz -#define APB1_FREQ (CORE_FREQ/2U) -#define APB1_TIMER_FREQ (APB1_FREQ*2U) // APB1 is multiplied by 2 for the timer peripherals -#define APB2_FREQ (CORE_FREQ/2U) -#define APB2_TIMER_FREQ (APB2_FREQ*2U) // APB2 is multiplied by 2 for the timer peripherals - -#define BOOTLOADER_ADDRESS 0x1FFF0004U - -// Around (1Mbps / 8 bits/byte / 12 bytes per message) -#define CAN_INTERRUPT_RATE 12000U - -#define MAX_LED_FADE 8192U - -#define NUM_INTERRUPTS 102U // There are 102 external interrupt sources (see stm32f413.h) - -#define TICK_TIMER_IRQ TIM1_BRK_TIM9_IRQn -#define TICK_TIMER TIM9 - -#define MICROSECOND_TIMER TIM2 - -#define INTERRUPT_TIMER_IRQ TIM6_DAC_IRQn -#define INTERRUPT_TIMER TIM6 - -#define IND_WDG IWDG - -#define PROVISION_CHUNK_ADDRESS 0x1FFF79E0U -#define DEVICE_SERIAL_NUMBER_ADDRESS 0x1FFF79C0U #include "can.h" #include "comms_definitions.h" -#ifndef BOOTSTUB - #include "main_definitions.h" -#else - #include "bootstub_declarations.h" -#endif - #include "libc.h" #include "critical.h" #include "faults.h" diff --git a/include/board/stm32f4/stm32f4_platform_definitions.h b/include/board/stm32f4/stm32f4_platform_definitions.h new file mode 100644 index 00000000000..48d1dd34dc0 --- /dev/null +++ b/include/board/stm32f4/stm32f4_platform_definitions.h @@ -0,0 +1,35 @@ +#pragma once +#include "stm32f4/inc/stm32f4xx.h" +#include "stm32f4/inc/stm32f4xx_hal_gpio_ex.h" +#define MCU_IDCODE 0x463U + +#define CORE_FREQ 96U // in MHz +#define APB1_FREQ (CORE_FREQ / 2U) +#define APB1_TIMER_FREQ \ +(APB1_FREQ * 2U) // APB1 is multiplied by 2 for the timer peripherals +#define APB2_FREQ (CORE_FREQ / 2U) +#define APB2_TIMER_FREQ \ +(APB2_FREQ * 2U) // APB2 is multiplied by 2 for the timer peripherals + +#define BOOTLOADER_ADDRESS 0x1FFF0004U + +// Around (1Mbps / 8 bits/byte / 12 bytes per message) +#define CAN_INTERRUPT_RATE 12000U + +#define MAX_LED_FADE 8192U + +#define NUM_INTERRUPTS \ +102U // There are 102 external interrupt sources (see stm32f413.h) + +#define TICK_TIMER_IRQ TIM1_BRK_TIM9_IRQn +#define TICK_TIMER TIM9 + +#define MICROSECOND_TIMER TIM2 + +#define INTERRUPT_TIMER_IRQ TIM6_DAC_IRQn +#define INTERRUPT_TIMER TIM6 + +#define IND_WDG IWDG + +#define PROVISION_CHUNK_ADDRESS 0x1FFF79E0U +#define DEVICE_SERIAL_NUMBER_ADDRESS 0x1FFF79C0U diff --git a/board/stm32h7/stm32h7_config.h b/include/board/stm32h7/stm32h7_config.h similarity index 51% rename from board/stm32h7/stm32h7_config.h rename to include/board/stm32h7/stm32h7_config.h index bfc12e8c3a2..610171ee9df 100644 --- a/board/stm32h7/stm32h7_config.h +++ b/include/board/stm32h7/stm32h7_config.h @@ -1,57 +1,9 @@ #include "stm32h7/inc/stm32h7xx.h" #include "stm32h7/inc/stm32h7xx_hal_gpio_ex.h" -#define MCU_IDCODE 0x483U - -#define CORE_FREQ 240U // in Mhz -//APB1 - 120Mhz, APB2 - 120Mhz -#define APB1_FREQ (CORE_FREQ/4U) -#define APB1_TIMER_FREQ (APB1_FREQ*2U) // APB1 is multiplied by 2 for the timer peripherals -#define APB2_FREQ (CORE_FREQ/4U) -#define APB2_TIMER_FREQ (APB2_FREQ*2U) // APB2 is multiplied by 2 for the timer peripherals - -#define BOOTLOADER_ADDRESS 0x1FF09804U - -/* -An IRQ is received on message RX/TX (or RX errors), with -separate IRQs for RX and TX. - -0-byte CAN FD frame as the worst case: -- 17 slow bits = SOF + 11 ID + R1 + IDE + EDL + R0 + BRS -- 23 fast bits = ESI + 4 DLC + 0 DATA + 17 CRC + CRC delimeter -- 12 slow bits = ACK + DEL + 7 EOF + 3 IFS -- all currently supported cars are 0.5 Mbps / 2 Mbps - -1 / ((29 bits / 0.5Mbps) + (23 bits / 2Mbps)) = 14388Hz -*/ -#define CAN_INTERRUPT_RATE 16000U - -#define MAX_LED_FADE 10240U - -// There are 163 external interrupt sources (see stm32f735xx.h) -#define NUM_INTERRUPTS 163U - -#define TICK_TIMER_IRQ TIM8_BRK_TIM12_IRQn -#define TICK_TIMER TIM12 - -#define MICROSECOND_TIMER TIM2 - -#define INTERRUPT_TIMER_IRQ TIM6_DAC_IRQn -#define INTERRUPT_TIMER TIM6 - -#define IND_WDG IWDG1 - -#define PROVISION_CHUNK_ADDRESS 0x080FFFE0U -#define DEVICE_SERIAL_NUMBER_ADDRESS 0x080FFFC0U #include "can.h" #include "comms_definitions.h" -#ifndef BOOTSTUB - #include "main_definitions.h" -#else - #include "bootstub_declarations.h" -#endif - #include "libc.h" #include "critical.h" #include "faults.h" diff --git a/include/board/stm32h7/stm32h7_platform_definitions.h b/include/board/stm32h7/stm32h7_platform_definitions.h new file mode 100644 index 00000000000..dd10165e8d2 --- /dev/null +++ b/include/board/stm32h7/stm32h7_platform_definitions.h @@ -0,0 +1,45 @@ +#pragma once +#include "stm32h7/inc/stm32h7xx.h" +#include "stm32h7/inc/stm32h7xx_hal_gpio_ex.h" +#define MCU_IDCODE 0x483U + +#define CORE_FREQ 240U // in Mhz +// APB1 - 120Mhz, APB2 - 120Mhz +#define APB1_FREQ (CORE_FREQ / 4U) +#define APB1_TIMER_FREQ \ +(APB1_FREQ * 2U) // APB1 is multiplied by 2 for the timer peripherals +#define APB2_FREQ (CORE_FREQ / 4U) +#define APB2_TIMER_FREQ \ +(APB2_FREQ * 2U) // APB2 is multiplied by 2 for the timer peripherals + +#define BOOTLOADER_ADDRESS 0x1FF09804U + +/* +An IRQ is received on message RX/TX (or RX errors), with +separate IRQs for RX and TX. +0-byte CAN FD frame as the worst case: +- 17 slow bits = SOF + 11 ID + R1 + IDE + EDL + R0 + BRS +- 23 fast bits = ESI + 4 DLC + 0 DATA + 17 CRC + CRC delimeter +- 12 slow bits = ACK + DEL + 7 EOF + 3 IFS +- all currently supported cars are 0.5 Mbps / 2 Mbps +1 / ((29 bits / 0.5Mbps) + (23 bits / 2Mbps)) = 14388Hz +*/ +#define CAN_INTERRUPT_RATE 16000U + +#define MAX_LED_FADE 10240U + +// There are 163 external interrupt sources (see stm32f735xx.h) +#define NUM_INTERRUPTS 163U + +#define TICK_TIMER_IRQ TIM8_BRK_TIM12_IRQn +#define TICK_TIMER TIM12 + +#define MICROSECOND_TIMER TIM2 + +#define INTERRUPT_TIMER_IRQ TIM6_DAC_IRQn +#define INTERRUPT_TIMER TIM6 + +#define IND_WDG IWDG1 + +#define PROVISION_CHUNK_ADDRESS 0x080FFFE0U +#define DEVICE_SERIAL_NUMBER_ADDRESS 0x080FFFC0U diff --git a/include/board/stm_config.h b/include/board/stm_config.h new file mode 100644 index 00000000000..6fb05103acb --- /dev/null +++ b/include/board/stm_config.h @@ -0,0 +1,11 @@ +#pragma once + +#ifdef STM32H7 +#include "stm32h7/stm32h7_config.h" +#elif defined(STM32F4) +#include "stm32f4/stm32f4_config.h" +#else +// TODO: uncomment this, cppcheck complains +// building for tests +//#include "fake_stm.h" +#endif diff --git a/tests/libpanda/SConscript b/tests/libpanda/SConscript index a690ba75776..c1cb32d1331 100644 --- a/tests/libpanda/SConscript +++ b/tests/libpanda/SConscript @@ -16,7 +16,12 @@ env = Environment( '-Wfatal-errors', '-Wno-pointer-to-int-cast', ], - CPPPATH=[".", "../../board/", "../../../opendbc/safety/"], + CPPPATH=[ + ".", + "../../board/", + "../../include/board/", + "../../../opendbc/safety/", + ] ) if system == "Darwin": env.PrependENVPath('PATH', '/opt/homebrew/bin') diff --git a/tests/libpanda/panda.c b/tests/libpanda/panda.c index 303d72e7d00..48b977c0fe8 100644 --- a/tests/libpanda/panda.c +++ b/tests/libpanda/panda.c @@ -1,5 +1,7 @@ #include "fake_stm.h" -#include "config.h" +#include "platform_definitions.h" +#include "board_config.h" +#include "stm_config.h" #include "can.h" bool can_init(uint8_t can_number) { return true; } diff --git a/tests/misra/test_misra.sh b/tests/misra/test_misra.sh index aaa7b0c365f..89fd694417b 100755 --- a/tests/misra/test_misra.sh +++ b/tests/misra/test_misra.sh @@ -44,7 +44,9 @@ cppcheck() { echo -e "\n\n\n\n\nTEST variant options:" >> $CHECKLIST echo -e ""${@//$PANDA_DIR/}"\n\n" >> $CHECKLIST # (absolute path removed) - $CPPCHECK_DIR/cppcheck --inline-suppr -I $PANDA_DIR/board/ \ + $CPPCHECK_DIR/cppcheck --inline-suppr \ + -I $PANDA_DIR/include/board/ \ + -I $PANDA_DIR/board/ \ -I "$(arm-none-eabi-gcc -print-file-name=include)" \ -I $PANDA_DIR/board/stm32f4/inc/ -I $PANDA_DIR/board/stm32h7/inc/ \ -I $PANDA_DIR/../opendbc/safety/ \