diff --git a/mouse/LedControl.cpp b/mouse/LedControl.cpp index 544a823..43937a1 100644 --- a/mouse/LedControl.cpp +++ b/mouse/LedControl.cpp @@ -86,10 +86,10 @@ void LedControl::setupBLEService(BLEServer *server) { void LedControl::loadSettings() { preferences.begin(LED_NAMESPACE, true); - currentR = preferences.getUChar("r", 0); - currentG = preferences.getUChar("g", 0); - currentB = preferences.getUChar("b", 0); - currentBrightness = preferences.getUChar("br", 0); + currentR = preferences.getUChar("r", RED_DEFAULT); + currentG = preferences.getUChar("g", GREEN_DEFAULT); + currentB = preferences.getUChar("b", BLUE_DEFAULT); + currentBrightness = preferences.getUChar("br", BRIGHT_DEFAULT); preferences.end(); } diff --git a/mouse/LedControl.h b/mouse/LedControl.h index daa5383..509b863 100644 --- a/mouse/LedControl.h +++ b/mouse/LedControl.h @@ -15,6 +15,11 @@ #define COLOR_CHAR_B_UUID "12345678-1234-5678-1234-56789abcdef3" #define COLOR_CHAR_BRIGHTNESS_UUID "12345678-1234-5678-1234-56789abcdef4" +#define RED_DEFAULT 255 +#define GREEN_DEFAULT 0 +#define BLUE_DEFAULT 255 +#define BRIGHT_DEFAULT 50 + class LedControl { public: LedControl(Adafruit_NeoPixel &led) diff --git a/mouse/mouse.ino b/mouse/mouse.ino index 537aee1..6bd3833 100644 --- a/mouse/mouse.ino +++ b/mouse/mouse.ino @@ -5,10 +5,6 @@ #define LED_PIN 21 // GPIO пин светодиода (скорее всего 48) #define NUM_LEDS 1 // Один RGB светодиод -#define RED_DEFAULT 255 -#define GREEN_DEFAULT 0 -#define BLUE_DEFAULT 255 -#define BRIGHT_DEFAULT 50 // #define DISABLE_RGB_UUID // #define DISABLE_USB