forked from xiaozhi/xiaozhi-esp32
Add single-led support for SenseCAP Watcher (#373)
* add single-led support for SenseCAP Watcher * Rename blaklight.cc to backlight.cc
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define BUILTIN_LED_GPIO GPIO_NUM_NC
|
#define BUILTIN_LED_GPIO GPIO_NUM_40
|
||||||
#define BOOT_BUTTON_GPIO GPIO_NUM_0
|
#define BOOT_BUTTON_GPIO GPIO_NUM_0
|
||||||
#define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
|
#define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
|
||||||
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
|
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "button.h"
|
#include "button.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "led/single_led.h"
|
||||||
#include "iot/thing_manager.h"
|
#include "iot/thing_manager.h"
|
||||||
#include "power_save_timer.h"
|
#include "power_save_timer.h"
|
||||||
|
|
||||||
@@ -280,6 +281,14 @@ public:
|
|||||||
return &backlight;
|
return &backlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据 https://github.com/Seeed-Studio/OSHW-SenseCAP-Watcher/blob/main/Hardware/SenseCAP_Watcher_v1.0_SCH.pdf
|
||||||
|
// RGB LED型号为 ws2813 mini, 连接在GPIO 40,供电电压 3.3v, 没有连接 BIN 双信号线
|
||||||
|
// 可以直接兼容SingleLED采用的ws2812
|
||||||
|
virtual Led* GetLed() override {
|
||||||
|
static SingleLed led(BUILTIN_LED_GPIO);
|
||||||
|
return &led;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void SetPowerSaveMode(bool enabled) override {
|
virtual void SetPowerSaveMode(bool enabled) override {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
power_save_timer_->WakeUp();
|
power_save_timer_->WakeUp();
|
||||||
|
|||||||
@@ -35,4 +35,4 @@ public:
|
|||||||
|
|
||||||
} // namespace iot
|
} // namespace iot
|
||||||
|
|
||||||
DECLARE_THING(Backlight);
|
DECLARE_THING(Backlight);
|
||||||
Reference in New Issue
Block a user