forked from achamaikin/CCSModuleSW30Web
clean project
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#include "rgb_controller.h"
|
||||
#include "main.h"
|
||||
#include "string.h"
|
||||
#include "charger_control.h"
|
||||
#include "board.h"
|
||||
|
||||
#include "board.h"
|
||||
#include "charger_control.h"
|
||||
#include "main.h"
|
||||
#include "tim.h"
|
||||
#include <string.h>
|
||||
|
||||
RGB_State_t LED_State;
|
||||
RGB_Cycle_t LED_Cycle;
|
||||
@@ -198,36 +198,11 @@ void LED_Init(){
|
||||
RGB_SetColor(&color);
|
||||
}
|
||||
|
||||
// void LED_PhaseSync(uint8_t led_n){
|
||||
// if(LED_State[led_n].phasesync){
|
||||
// LED_State[led_n].phasesync = 0;
|
||||
// //default settings
|
||||
// LED_State[led_n].state = LED_HIGH;
|
||||
// LED_State[led_n].tick = 0;
|
||||
// //ищем среди всех светодиодов такую же последовательность
|
||||
// for (uint8_t led_n1 = 0; led_n1 < 5; led_n1++){
|
||||
// if ((LED_Cycle[led_n].Tf == LED_Cycle[led_n1].Tf) &&
|
||||
// (LED_Cycle[led_n].Tr == LED_Cycle[led_n1].Tr) &&
|
||||
// (LED_Cycle[led_n].Th == LED_Cycle[led_n1].Th) &&
|
||||
// (LED_Cycle[led_n].Tl == LED_Cycle[led_n1].Tl) &&
|
||||
// (led_n != led_n1)){
|
||||
// //если нашли, то копируем фазу оттуда
|
||||
// LED_State[led_n].state = LED_State[led_n1].state;
|
||||
// LED_State[led_n].tick = LED_State[led_n1].tick;
|
||||
// return;
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
void LED_Task(){
|
||||
static uint32_t led_tick;
|
||||
if((HAL_GetTick() - led_tick) > 20){
|
||||
led_tick = HAL_GetTick();
|
||||
LED_State.tick++;
|
||||
// LED_PhaseSync(led_n);
|
||||
switch(LED_State.state){
|
||||
case LED_RISING:
|
||||
interpolateColors(&LED_Cycle.Color2, &LED_Cycle.Color1, LED_State.tick, LED_Cycle.Tr, &LED_State.color);
|
||||
|
||||
Reference in New Issue
Block a user