feat: logging service
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "NeoPixelService.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
#include "spore/services/LoggingService.h"
|
||||
|
||||
// Wheel helper: map 0-255 to RGB rainbow
|
||||
static uint32_t colorWheel(Adafruit_NeoPixel& strip, uint8_t pos) {
|
||||
@@ -104,7 +105,8 @@ void NeoPixelService::handleControlRequest(AsyncWebServerRequest* request) {
|
||||
|
||||
if (request->hasParam("brightness", true)) {
|
||||
int b = request->getParam("brightness", true)->value().toInt();
|
||||
if (b < 0) b = 0; if (b > 255) b = 255;
|
||||
if (b < 0) b = 0;
|
||||
if (b > 255) b = 255;
|
||||
setBrightness((uint8_t)b);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <Arduino.h>
|
||||
#include "spore/Spore.h"
|
||||
#include "spore/services/LoggingService.h"
|
||||
#include "NeoPixelService.h"
|
||||
|
||||
#ifndef NEOPIXEL_PIN
|
||||
@@ -36,7 +37,7 @@ void setup() {
|
||||
// Start the API server and complete initialization
|
||||
spore.begin();
|
||||
|
||||
Serial.println("[Main] NeoPixel service registered and ready!");
|
||||
LOG_INFO(spore.getContext(), "Main", "NeoPixel service registered and ready!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user