From ebc4a532403bfdefab2ea81873285d95eb6c0d9c Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Wed, 12 Jun 2024 16:48:39 +0200 Subject: [PATCH] Rename RGB registers --- src/RGBLED.cpp | 12 ++++++------ src/registers.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/RGBLED.cpp b/src/RGBLED.cpp index e0a70cc..07addc3 100644 --- a/src/RGBLED.cpp +++ b/src/RGBLED.cpp @@ -11,8 +11,8 @@ void RGBLED::enableIndoorAirQualityStatus() { void RGBLED::enableIndoorAirQualityStatus(uint8_t brightness) { writeToRegister(RGB_LED_RED_REGISTER_INFO, 0); - writeToRegister(GREEN_REGISTER_INFO, 0); - writeToRegister(BLUE_REGISTER_INFO, 0); + writeToRegister(RGB_LED_GREEN_REGISTER_INFO, 0); + writeToRegister(RGB_LED_BLUE_REGISTER_INFO, 0); writeToRegister(INTENSITY_REGISTER_INFO, brightness); } @@ -22,8 +22,8 @@ void RGBLED::setColor(uint8_t r, uint8_t g, uint8_t b) { void RGBLED::setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t brightness) { writeToRegister(RGB_LED_RED_REGISTER_INFO, r); - writeToRegister(GREEN_REGISTER_INFO, g); - writeToRegister(BLUE_REGISTER_INFO, b); + writeToRegister(RGB_LED_GREEN_REGISTER_INFO, g); + writeToRegister(RGB_LED_BLUE_REGISTER_INFO, b); writeToRegister(INTENSITY_REGISTER_INFO, brightness); } @@ -37,8 +37,8 @@ void RGBLED::setColor(Color color, uint8_t brightness) { Color RGBLED::color() { uint8_t red = readFromRegister(RGB_LED_RED_REGISTER_INFO); - uint8_t green = readFromRegister(GREEN_REGISTER_INFO); - uint8_t blue = readFromRegister(BLUE_REGISTER_INFO); + uint8_t green = readFromRegister(RGB_LED_GREEN_REGISTER_INFO); + uint8_t blue = readFromRegister(RGB_LED_BLUE_REGISTER_INFO); return {red, green, blue}; } diff --git a/src/registers.h b/src/registers.h index 92df6af..94bc032 100644 --- a/src/registers.h +++ b/src/registers.h @@ -16,8 +16,8 @@ constexpr RegisterInfo SLAVE_ADDRESS_REGISTER_INFO{0x01, "uint8", 1}; constexpr RegisterInfo CONTROL_REGISTER_INFO{0x02, "uint8", 1}; constexpr RegisterInfo ORANGE_LED_REGISTER_INFO{0x03, "uint8", 1}; constexpr RegisterInfo RGB_LED_RED_REGISTER_INFO{0x04, "uint8", 1}; -constexpr RegisterInfo GREEN_REGISTER_INFO{0x05, "uint8", 1}; -constexpr RegisterInfo BLUE_REGISTER_INFO{0x06, "uint8", 1}; +constexpr RegisterInfo RGB_LED_GREEN_REGISTER_INFO{0x05, "uint8", 1}; +constexpr RegisterInfo RGB_LED_BLUE_REGISTER_INFO{0x06, "uint8", 1}; constexpr RegisterInfo INTENSITY_REGISTER_INFO{0x07, "uint8", 1}; constexpr RegisterInfo UART_CONTROL_REGISTER_INFO{0x08, "uint8", 1}; constexpr RegisterInfo CSV_DELIMITER_REGISTER_INFO{0x09, "uint8", 1};