forked from achamaikin/CCSModuleSW30Web
Enhance board and PSU control structures; update connector state handling and stop button logic. Adjust LED color cycles for better visual feedback. Refactor serial communication to improve state management and error handling.
This commit is contained in:
+28
-10
@@ -2,6 +2,7 @@
|
||||
#include "main.h"
|
||||
#include "string.h"
|
||||
#include "charger_control.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "tim.h"
|
||||
|
||||
@@ -10,11 +11,20 @@ RGB_Cycle_t LED_Cycle;
|
||||
|
||||
RGB_Cycle_t color_estop = {
|
||||
.Color1 = { .R = 250, .G = 0, .B = 0 },
|
||||
.Color2 = { .R = 250, .G = 0, .B = 0 },
|
||||
.Tr = 50,
|
||||
.Th = 50,
|
||||
.Tf = 50,
|
||||
.Tl = 50,
|
||||
.Color2 = { .R = 0, .G = 0, .B = 0 },
|
||||
.Tr = 10,
|
||||
.Th = 5,
|
||||
.Tf = 10,
|
||||
.Tl = 5,
|
||||
};
|
||||
|
||||
RGB_Cycle_t color_unlock = {
|
||||
.Color1 = { .R = 255, .G = 0, .B = 0 },
|
||||
.Color2 = { .R = 0, .G = 0, .B = 0 },
|
||||
.Tr = 10,
|
||||
.Th = 10,
|
||||
.Tf = 10,
|
||||
.Tl = 10,
|
||||
};
|
||||
|
||||
RGB_Cycle_t color_unknown = {
|
||||
@@ -54,12 +64,12 @@ RGB_Cycle_t color_unplugged = {
|
||||
};
|
||||
|
||||
RGB_Cycle_t color_preparing = {
|
||||
.Color1 = { .R = 0, .G = 0, .B = 250 },
|
||||
.Color2 = { .R = 0, .G = 0, .B = 250 },
|
||||
.Tr = 50,
|
||||
.Color1 = { .R = 0, .G = 0, .B = 255 },
|
||||
.Color2 = { .R = 0, .G = 0, .B = 0 },
|
||||
.Tr = 10,
|
||||
.Th = 10,
|
||||
.Tf = 50,
|
||||
.Tl = 0,
|
||||
.Tf = 10,
|
||||
.Tl = 10,
|
||||
};
|
||||
|
||||
RGB_Cycle_t color_charging = {
|
||||
@@ -94,6 +104,14 @@ void LED_Write(){
|
||||
LED_SetColor(&color_error);
|
||||
return;
|
||||
}
|
||||
if(CONN.connControl == CMD_FORCE_UNLOCK){
|
||||
LED_SetColor(&color_unlock);
|
||||
return;
|
||||
}
|
||||
if(CONN.connControl == CMD_STOP){
|
||||
LED_SetColor(&color_estop);
|
||||
return;
|
||||
}
|
||||
switch(CONN.connState){
|
||||
case Unknown:
|
||||
LED_SetColor(&color_unknown);
|
||||
|
||||
Reference in New Issue
Block a user