2121#include "iot_button.h"
2222#include "iot_knob.h"
2323
24- static const char * TAG = "bthome_dimmer" ;
25-
26- static const uint8_t encrypt_key [] = {0x23 , 0x1d , 0x39 , 0xc1 , 0xd7 , 0xcc , 0x1a , 0xb1 , 0xae , 0xe2 , 0x24 , 0xcd , 0x09 , 0x6d , 0xb9 , 0x32 };
27- static const uint8_t local_mac [] = { 0x54 , 0x48 , 0xE6 , 0x8F , 0x80 , 0xA5 };
28- static const uint8_t peer_mac [] = { 0x54 , 0x48 , 0xE6 , 0x8F , 0x80 , 0xA6 };
29-
3024#define GPIO_OUTPUT_PIN_SEL (1ULL << CONFIG_EXAMPLE_POWER_CTRL_IO_NUM)
3125
26+ static const char * TAG = "bthome_dimmer" ;
27+
3228typedef enum {
3329 TASK_EVENT_NONE = 0 ,
3430 TASK_EVENT_BTN ,
@@ -50,6 +46,9 @@ typedef struct {
5046 button_event_t button_event ;
5147} dimmer_t ;
5248
49+ static const uint8_t encrypt_key [] = {0x23 , 0x1d , 0x39 , 0xc1 , 0xd7 , 0xcc , 0x1a , 0xb1 , 0xae , 0xe2 , 0x24 , 0xcd , 0x09 , 0x6d , 0xb9 , 0x32 };
50+ static const uint8_t local_mac [] = { 0x54 , 0x48 , 0xE6 , 0x8F , 0x80 , 0xA5 };
51+ static const uint8_t peer_mac [] = { 0x54 , 0x48 , 0xE6 , 0x8F , 0x80 , 0xA6 };
5352static dimmer_t * s_dimmer ;
5453
5554static void knob_event_cb (void * arg , void * data )
@@ -258,7 +257,6 @@ static void settings_load(bthome_handle_t handle, const char *key, uint8_t *data
258257
259258void app_main (void )
260259{
261-
262260 // Initialize NVS
263261 esp_err_t ret = nvs_flash_init ();
264262 if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND ) {
0 commit comments