diff options
Diffstat (limited to 'platformio/common/libs/led')
-rw-r--r-- | platformio/common/libs/led/homekit/led.cpp | 9 | ||||
-rw-r--r-- | platformio/common/libs/led/homekit/led.h | 13 | ||||
-rw-r--r-- | platformio/common/libs/led/library.json | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/platformio/common/libs/led/homekit/led.cpp b/platformio/common/libs/led/homekit/led.cpp index acc2140..ffefb04 100644 --- a/platformio/common/libs/led/homekit/led.cpp +++ b/platformio/common/libs/led/homekit/led.cpp @@ -1,6 +1,6 @@ #include "led.h" -namespace homekit { +namespace homekit::led { void Led::on_off(uint16_t delay_ms, bool last_delay) const { on(); @@ -17,4 +17,11 @@ void Led::blink(uint8_t count, uint16_t delay_ms) const { } } + +#ifdef CONFIG_TARGET_NODEMCU +const Led* board_led = new Led(CONFIG_BOARD_LED_GPIO); +#endif +const Led* mcu_led = new Led(CONFIG_MCU_LED_GPIO); + + } diff --git a/platformio/common/libs/led/homekit/led.h b/platformio/common/libs/led/homekit/led.h index 513bfea..775d2eb 100644 --- a/platformio/common/libs/led/homekit/led.h +++ b/platformio/common/libs/led/homekit/led.h @@ -1,10 +1,10 @@ -#ifndef COMMON_HOMEKIT_LED_H -#define COMMON_HOMEKIT_LED_H +#ifndef HOMEKIT_LIB_LED_H +#define HOMEKIT_LIB_LED_H #include <Arduino.h> #include <stdint.h> -namespace homekit { +namespace homekit::led { class Led { private: @@ -23,6 +23,11 @@ public: void blink(uint8_t count, uint16_t delay_ms) const; }; +#ifdef CONFIG_TARGET_NODEMCU +extern const Led* board_led; +#endif +extern const Led* mcu_led; + } -#endif //COMMON_HOMEKIT_LED_H +#endif //HOMEKIT_LIB_LED_H diff --git a/platformio/common/libs/led/library.json b/platformio/common/libs/led/library.json index 69a3ac3..6785d42 100644 --- a/platformio/common/libs/led/library.json +++ b/platformio/common/libs/led/library.json @@ -1,6 +1,6 @@ { "name": "homekit_led", - "version": "1.0.6", + "version": "1.0.8", "build": { "flags": "-I../../include" } |