feat: replace lightdriver, and support more chips in ble mesh examples
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "driver/gpio.h"
|
||||
#include "lightbulb.h"
|
||||
#include "esp_log.h"
|
||||
#include "board.h"
|
||||
|
||||
@@ -18,7 +19,7 @@
|
||||
void board_led_operation(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
#ifdef BLE_MESH_LED_STRIP_IO
|
||||
rmt_led_set(r, g, b);
|
||||
ws2812_set_rgb_channel(r, g, b);
|
||||
#else
|
||||
gpio_set_level(LED_R, r);
|
||||
gpio_set_level(LED_G, g);
|
||||
@@ -29,8 +30,25 @@ void board_led_operation(uint8_t r, uint8_t g, uint8_t b)
|
||||
static void board_led_init(void)
|
||||
{
|
||||
#ifdef BLE_MESH_LED_STRIP_IO
|
||||
rmt_encoder_init();
|
||||
rmt_led_set(LED_OFF,LED_OFF,LED_OFF);
|
||||
lightbulb_config_t config = {
|
||||
.type = DRIVER_WS2812,
|
||||
.driver_conf.ws2812.led_num = 3,
|
||||
.driver_conf.ws2812.ctrl_io = 8,
|
||||
.capability.enable_fades = true,
|
||||
.capability.fades_ms = 800,
|
||||
.capability.enable_status_storage = false,
|
||||
.capability.mode_mask = COLOR_MODE,
|
||||
.capability.storage_cb = NULL,
|
||||
.external_limit = NULL,
|
||||
.gamma_conf = NULL,
|
||||
.init_status.mode = WORK_COLOR,
|
||||
.init_status.on = false,
|
||||
.init_status.hue = 0,
|
||||
.init_status.saturation = 100,
|
||||
.init_status.value = 100,
|
||||
};
|
||||
lightbulb_init(&config);
|
||||
ws2812_set_rgb_channel(LED_OFF, LED_OFF, LED_OFF);
|
||||
#else
|
||||
gpio_set_level(LED_R, LED_OFF);
|
||||
gpio_set_level(LED_G, LED_OFF);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#define _BOARD_H_
|
||||
|
||||
#include "driver/gpio.h"
|
||||
#include "led_strip_encoder.h"
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_ESP_WROOM_32)
|
||||
#define LED_R GPIO_NUM_25
|
||||
|
||||
Reference in New Issue
Block a user