Fix scope error by moving declaration

This commit is contained in:
2026-06-14 20:48:11 +02:00
parent 17febf569a
commit 19eefc288b
3 changed files with 17 additions and 13 deletions
+16
View File
@@ -30,11 +30,27 @@ extern osMessageQueueId_t xCAN2RxQueue;
extern osSemaphoreId_t xLEDSemaphoreCAN1; extern osSemaphoreId_t xLEDSemaphoreCAN1;
extern osSemaphoreId_t xLEDSemaphoreCAN2; 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 { typedef struct {
LED_Config *led; LED_Config *led;
osSemaphoreId_t semaphore; osSemaphoreId_t semaphore;
osTimerId_t timer; osTimerId_t timer;
} LEDContext; } LEDContext;
/* USER CODE END PTD */
/** /**
* @brief Initializes the CAN logger modules, OS threads, queues, and hardware. * @brief Initializes the CAN logger modules, OS threads, queues, and hardware.
+1
View File
@@ -28,6 +28,7 @@ extern "C" {
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"
#include "canlog.h"
/* Private includes ----------------------------------------------------------*/ /* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */ /* USER CODE BEGIN Includes */
-13
View File
@@ -27,19 +27,6 @@
/* Private typedef -----------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */ /* 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 */ /* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/