big refactoring: J1939, log output, state machine bug fixes

This commit is contained in:
2026-05-07 22:12:13 +03:00
parent 137c9d3c8d
commit 7a74ef1367
49 changed files with 2574 additions and 684 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef INC_CP_H_
#define INC_CP_H_
#include "main.h"
typedef enum {
EV_STATE_A_IDLE = 0,
EV_STATE_B_CONN_PREP = 1,
EV_STATE_C_CONN_ACTIVE = 2,
EV_STATE_D_CONN_ACT_VENT = 3,
EV_STATE_E_NO_POWER = 4,
EV_STATE_F_ERROR = 5,
EV_STATE_ACQUIRING = 6,
} CP_State_t;
typedef struct {
uint32_t frequency_hz;
uint8_t duty_percent;
uint8_t valid;
} CP_Measurement_t;
extern volatile CP_State_t cp_state;
void CP_Init(void);
void CP_Task(void);
CP_Measurement_t CP_GetMeasurement(void);
#endif /* INC_CP_H_ */