2023-09-27 15:45:31 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
//#define DEBUG
|
|
|
|
//#define DEBUG_UART
|
|
|
|
//#define DEBUG_USB
|
|
|
|
//#define DEBUG_SPI
|
|
|
|
//#define DEBUG_FAULTS
|
|
|
|
//#define DEBUG_COMMS
|
|
|
|
//#define DEBUG_FAN
|
|
|
|
|
|
|
|
#define CAN_INIT_TIMEOUT_MS 500U
|
|
|
|
#define USBPACKET_MAX_SIZE 0x40U
|
|
|
|
#define MAX_CAN_MSGS_PER_USB_BULK_TRANSFER 51U
|
|
|
|
#define MAX_CAN_MSGS_PER_SPI_BULK_TRANSFER 170U
|
|
|
|
|
|
|
|
// USB definitions
|
2025-01-29 09:09:58 +00:00
|
|
|
#define USB_VID 0x3801U
|
2023-09-27 15:45:31 -07:00
|
|
|
|
2023-11-17 23:53:40 +00:00
|
|
|
#ifdef PANDA_JUNGLE
|
|
|
|
#ifdef BOOTSTUB
|
|
|
|
#define USB_PID 0xDDEFU
|
|
|
|
#else
|
|
|
|
#define USB_PID 0xDDCFU
|
|
|
|
#endif
|
2023-09-27 15:45:31 -07:00
|
|
|
#else
|
2023-11-17 23:53:40 +00:00
|
|
|
#ifdef BOOTSTUB
|
|
|
|
#define USB_PID 0xDDEEU
|
|
|
|
#else
|
|
|
|
#define USB_PID 0xDDCCU
|
|
|
|
#endif
|
2023-09-27 15:45:31 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// platform includes
|
|
|
|
#ifdef STM32H7
|
|
|
|
#include "stm32h7/stm32h7_config.h"
|
2024-02-21 23:02:43 +00:00
|
|
|
#elif defined(STM32F4)
|
2024-06-11 01:36:40 +00:00
|
|
|
#include "stm32f4/stm32f4_config.h"
|
2023-09-27 15:45:31 -07:00
|
|
|
#else
|
|
|
|
// TODO: uncomment this, cppcheck complains
|
|
|
|
// building for tests
|
|
|
|
//#include "fake_stm.h"
|
|
|
|
#endif
|