Move clock sync logic to separate files

This commit is contained in:
jazzpi
2022-08-01 08:17:43 +02:00
parent 372d07af84
commit bd9d86b168
5 changed files with 37 additions and 4 deletions

View File

@ -21,7 +21,7 @@
#define SLAVE_STATUS_BASE_ADDRESS 0x600
#define SLAVE_CMD_BASE_ADDRESS 0x500 //
#define SLAVE_EMERGENCY_ADDRESS 0x001 // Emergency Frame
#define TIME_SYNC_ADDRESS 0x002
#define CLOCK_SYNC_ADDRESS 0x002
typedef struct {
int16_t FrameID;

11
Core/Inc/Clock_Sync.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef INC_CLOCK_SYNC_H_
#define INC_CLOCK_SYNC_H_
#include "stm32g4xx_hal.h"
#include "stm32g4xx_hal_fdcan.h"
void clock_sync_init(FDCAN_HandleTypeDef* can, TIM_HandleTypeDef* timer);
void clock_sync_handle_timer_complete();
#endif // INC_CLOCK_SYNC_H_