@@ -25,7 +25,7 @@ extern const unsigned char u2f_cert_key_end[] asm("_binary_u2f_cert_key_bin_end"
25
25
static SemaphoreHandle_t hid_tx_requested = NULL ;
26
26
static SemaphoreHandle_t hid_tx_done = NULL ;
27
27
static QueueHandle_t hid_queue = NULL ;
28
- static TaskHandle_t led_task = NULL ;
28
+ static TaskHandle_t led_btn_task = NULL ;
29
29
30
30
volatile static uint8_t touch_result ;
31
31
static uint32_t last_blink = UINT32_MAX , blink_timeout , blink_interval ;
@@ -231,7 +231,7 @@ void device_init(void)
231
231
232
232
#ifdef CONFIG_BUTTON_ENABLE
233
233
const gpio_config_t boot_button_config = {
234
- .pin_bit_mask = BIT64 (BUTTON_GPIO ),
234
+ .pin_bit_mask = BIT64 (CONFIG_BUTTON_GPIO ),
235
235
.mode = GPIO_MODE_INPUT ,
236
236
.intr_type = GPIO_INTR_DISABLE ,
237
237
.pull_up_en = true,
@@ -256,7 +256,7 @@ void device_init(void)
256
256
ctap_install_private_key (u2f_cert_key_start , u2f_cert_key_end - u2f_cert_key_start );
257
257
}
258
258
259
- xTaskCreate (device_update_led_btn , "led_task " , configMINIMAL_STACK_SIZE * 2 , NULL , 10 , & led_task );
259
+ xTaskCreate (device_update_led_btn , "led_btn_task " , configMINIMAL_STACK_SIZE * 2 , NULL , 10 , & led_btn_task );
260
260
261
261
ESP_LOGI (TAG , "u2f device init done" );
262
262
}
@@ -285,6 +285,8 @@ void device_loop(uint8_t has_touch)
285
285
}
286
286
287
287
CTAPHID_Loop (0 );
288
+
289
+ //ESP_LOGI(TAG, "[APP] Free memory: %" PRIu32 " bytes", esp_get_free_heap_size());
288
290
}
289
291
290
292
void tud_hid_report_complete_cb (uint8_t instance , uint8_t const * report , /*uint16_t*/ uint8_t len )
@@ -392,8 +394,8 @@ void device_update_led_btn(void *pvParam)
392
394
toggle_led ();
393
395
}
394
396
395
- #ifdef CONFIG_BUTTON_ENABLE
396
- if (!gpio_get_level (BUTTON_GPIO ))
397
+ #ifdef CONFIG_BUTTON_ENABLE
398
+ if (!gpio_get_level (CONFIG_BUTTON_GPIO ))
397
399
{
398
400
set_touch_result (TOUCH_SHORT );
399
401
}
0 commit comments