diff --git a/Core/Inc/canlog.h b/Core/Inc/canlog.h index 0ba9cb4..e74f699 100644 --- a/Core/Inc/canlog.h +++ b/Core/Inc/canlog.h @@ -30,11 +30,27 @@ extern osMessageQueueId_t xCAN2RxQueue; extern osSemaphoreId_t xLEDSemaphoreCAN1; extern osSemaphoreId_t xLEDSemaphoreCAN2; +/* USER CODE BEGIN PTD */ +typedef struct { + GPIO_TypeDef* port; + uint16_t pin; +} LED_Config; + +typedef struct { + uint32_t id; + uint8_t payload[8]; + uint8_t dlc; + uint8_t isExtended; + //uint32_t timestamp; //Enable TIM2: 42 MHz / (41+1) = 1 MHz → 1 µs tick; 32bit autoreload freerunning + // this is for getting timestamps on can messages +} CanMessage_t; + typedef struct { LED_Config *led; osSemaphoreId_t semaphore; osTimerId_t timer; } LEDContext; +/* USER CODE END PTD */ /** * @brief Initializes the CAN logger modules, OS threads, queues, and hardware. diff --git a/Core/Inc/main.h b/Core/Inc/main.h index b31c169..d819a71 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -28,6 +28,7 @@ extern "C" { /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" +#include "canlog.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ diff --git a/Core/Src/main.c b/Core/Src/main.c index bf17822..6ad4786 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -27,19 +27,6 @@ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ -typedef struct { - GPIO_TypeDef* port; - uint16_t pin; -} LED_Config; - -typedef struct { - uint32_t id; - uint8_t payload[8]; - uint8_t dlc; - uint8_t isExtended; - //uint32_t timestamp; //Enable TIM2: 42 MHz / (41+1) = 1 MHz → 1 µs tick; 32bit autoreload freerunning - // this is for getting timestamps on can messages -} CanMessage_t; /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/