Architecture cleanup
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "ws2812_drv.h"
|
||||
#include "ws2812_effect.h"
|
||||
#include "clock.h"
|
||||
//#include "clock.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
@@ -40,6 +40,12 @@ void clock_setColourSeconds(uint8_t r, uint8_t g, uint8_t b){
|
||||
}
|
||||
|
||||
|
||||
void ws_Effect_InitModule(void){
|
||||
|
||||
ws2812_Init();
|
||||
|
||||
}
|
||||
|
||||
void clock_setColourBackground(uint8_t r, uint8_t g, uint8_t b){
|
||||
|
||||
colour_background.r = r;
|
||||
@@ -52,7 +58,6 @@ void clock_setColourBackground(uint8_t r, uint8_t g, uint8_t b){
|
||||
|
||||
void ws_Effect_RoudTheClock(void){
|
||||
|
||||
#define RAND_MAX 25
|
||||
uint8_t r = rand();
|
||||
uint8_t g = rand();
|
||||
uint8_t b = rand();
|
||||
@@ -63,7 +68,6 @@ void ws_Effect_RoudTheClock(void){
|
||||
|
||||
ws2812_set_colour(led, r, g, b);
|
||||
ws2812_update();
|
||||
HAL_Delay(20);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -71,7 +75,6 @@ void ws_Effect_RoudTheClock(void){
|
||||
|
||||
void ws_Effect_RandRound(void){
|
||||
|
||||
#define RAND_MAX 25
|
||||
uint8_t r = rand();
|
||||
uint8_t g = rand();
|
||||
uint8_t b = rand();
|
||||
@@ -82,7 +85,6 @@ void ws_Effect_RandRound(void){
|
||||
|
||||
ws2812_set_colour(led, r, g, b);
|
||||
ws2812_update();
|
||||
HAL_Delay(20);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +100,6 @@ void ws_effect_display_time(uint8_t hour, uint8_t minute, uint8_t second){
|
||||
ws2812_update();
|
||||
ws2812_set_colour(second, colour_seconds.r, colour_seconds.g, colour_seconds.b);
|
||||
ws2812_update();
|
||||
|
||||
}
|
||||
|
||||
void ws_effect_display_hour(uint8_t hour){
|
||||
@@ -111,15 +112,12 @@ void ws_effect_display_hour(uint8_t hour){
|
||||
|
||||
void ws_Effect_RandRand(void){
|
||||
|
||||
#define RAND_MAX 25
|
||||
uint8_t r = rand();
|
||||
uint8_t g = rand();
|
||||
uint8_t b = rand();
|
||||
|
||||
#define RAND_MAX 24
|
||||
uint8_t led = rand();
|
||||
|
||||
ws2812_set_colour(led, r, g, b);
|
||||
ws2812_update();
|
||||
HAL_Delay(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user