Skip to content

Commit e5d1392

Browse files
loop233laride
authored andcommitted
feat(ble): update bthome example
1 parent 68399eb commit e5d1392

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
menu "BTHome Bulb Configuration"
2+
3+
config EXAMPLE_LED_STRIP_BLINK_GPIO
4+
int "LED Strip GPIO Pin"
5+
range 0 48
6+
default 8
7+
help
8+
GPIO number for LED strip data line.
9+
10+
config EXAMPLE_LED_STRIP_LED_NUMBERS
11+
int "Number of LEDs in Strip"
12+
range 1 255
13+
default 1
14+
help
15+
Number of LEDs in the LED strip.
16+
17+
config EXAMPLE_LED_STRIP_RMT_RES_HZ
18+
int "RMT Resolution Frequency (Hz)"
19+
range 1000000 10000000
20+
default 10000000
21+
help
22+
RMT counter clock frequency. 10MHz resolution means 1 tick = 0.1us.
23+
24+
endmenu

examples/bluetooth/ble_adv/bthome/bulb/main/app_main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#include "led_strip.h"
1717
#include "nvs_flash.h"
1818

19-
// GPIO assignment
20-
#define LED_STRIP_BLINK_GPIO 8
21-
// Numbers of the LED in the strip
22-
#define LED_STRIP_LED_NUMBERS 1
23-
// 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
24-
#define LED_STRIP_RMT_RES_HZ (10 * 1000 * 1000)
19+
// GPIO assignment from kconfig
20+
#define LED_STRIP_BLINK_GPIO CONFIG_EXAMPLE_LED_STRIP_BLINK_GPIO
21+
// Numbers of the LED in the strip from kconfig
22+
#define LED_STRIP_LED_NUMBERS CONFIG_EXAMPLE_LED_STRIP_LED_NUMBERS
23+
// RMT resolution from kconfig (led strip needs a high resolution)
24+
#define LED_STRIP_RMT_RES_HZ CONFIG_EXAMPLE_LED_STRIP_RMT_RES_HZ
2525

2626
static const char *TAG = "bt_home_bulb";
2727

0 commit comments

Comments
 (0)