animations: power: make configurable

This commit is contained in:
2023-02-19 18:45:28 +01:00
parent 8223688d7b
commit d824dbfa45
3 changed files with 48 additions and 27 deletions

View File

@@ -13,30 +13,14 @@
#include <time.h>
#include "animations/Power.h"
#include "inputs/ColorCycle.h"
#include "inputs/Buttons.h"
#include "SafeMode.h"
#define MAX_BRIGHTNESS 255
//#define PSU_MILLIAMPS 4800
//#define PSU_MILLIAMPS 500
//#define PSU_MILLIAMPS 1000
#define PSU_MILLIAMPS 1000
// Enable system thread, so rendering happens while booting
//SYSTEM_THREAD(ENABLED);
// Setup FastLED and the display
CRGB leds[HardwareConfig::MAX_LED_NUM];
Display dpy(leds, HardwareConfig::MAX_LED_NUM, Static<ConfigService>::instance()->coordMap());
// Setup power management
Power<MAX_BRIGHTNESS, PSU_MILLIAMPS> power;
REGISTER_TASK(power);
// FIXME: rewrite as static task
/*FigmentFunc configDisplay([](Display* dpy) {
uint8_t brightness = brighten8_video(beatsin8(60));