diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index 799f1924..cb487a92 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -144,6 +144,16 @@ menu "BlueRetro" help Select this to enable Generic HID report debug. + config BLUERETRO_ADAPTER_INPUT_DBG + bool "Enable adapter input debug" + help + Select this to enable adapter input debug. + + config BLUERETRO_ADAPTER_INPUT_MAP_DBG + bool "Enable adapter input mapping debug" + help + Select this to enable adapter input mapping debug. + config BLUERETRO_WIRED_TRACE bool "Enable wired trace" help diff --git a/main/adapter/adapter.c b/main/adapter/adapter.c index 6f31df55..c475a6d2 100644 --- a/main/adapter/adapter.c +++ b/main/adapter/adapter.c @@ -401,18 +401,13 @@ void IRAM_ATTR adapter_init_buffer(uint8_t wired_id) { } } -//#define INPUT_DBG -//#define INPUT_MAP_DBG void adapter_bridge(struct bt_data *bt_data) { uint32_t out_mask = 0; - //uint32_t end, start = xthal_get_ccount(); - //static uint32_t last = 0; - //uint32_t cur = xthal_get_ccount(); -#if 1 + if (bt_data->dev_id != BT_NONE && to_generic_func[bt_data->dev_type]) { to_generic_func[bt_data->dev_type](bt_data, &ctrl_input); -#ifdef INPUT_DBG +#ifdef CONFIG_BLUERETRO_ADAPTER_INPUT_DBG printf("LX: %s%08X%s, LY: %s%08X%s, RX: %s%08X%s, RY: %s%08X%s, LT: %s%08X%s, RT: %s%08X%s, BTNS: %s%08X%s, BTNS: %s%08X%s, BTNS: %s%08X%s, BTNS: %s%08X%s\n", BOLD, ctrl_input.axes[0].value, RESET, BOLD, ctrl_input.axes[1].value, RESET, BOLD, ctrl_input.axes[2].value, RESET, BOLD, ctrl_input.axes[3].value, RESET, BOLD, ctrl_input.axes[4].value, RESET, BOLD, ctrl_input.axes[5].value, RESET, BOLD, ctrl_input.btns[0].value, RESET, BOLD, ctrl_input.btns[1].value, RESET, @@ -423,7 +418,7 @@ void adapter_bridge(struct bt_data *bt_data) { out_mask = adapter_mapping(&config.in_cfg[bt_data->dev_id]); -#ifdef INPUT_MAP_DBG +#ifdef CONFIG_BLUERETRO_ADAPTER_INPUT_MAP_DBG printf("LX: %s%08X%s, LY: %s%08X%s, RX: %s%08X%s, RY: %s%08X%s, LT: %s%08X%s, RT: %s%08X%s, BTNS: %s%08X%s, BTNS: %s%08X%s, BTNS: %s%08X%s, BTNS: %s%08X%s\n", BOLD, ctrl_output[0].axes[0].value, RESET, BOLD, ctrl_output[0].axes[1].value, RESET, BOLD, ctrl_output[0].axes[2].value, RESET, BOLD, ctrl_output[0].axes[3].value, RESET, BOLD, ctrl_output[0].axes[4].value, RESET, BOLD, ctrl_output[0].axes[5].value, RESET, BOLD, ctrl_output[0].btns[0].value, RESET, BOLD, ctrl_output[0].btns[1].value, RESET, @@ -439,11 +434,6 @@ void adapter_bridge(struct bt_data *bt_data) { } #endif } -#endif - //end = xthal_get_ccount(); - //printf("%dus\n", (end - start)/CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ); - //printf("%dus\n", (cur - last)/CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ); - //last = cur; } void adapter_fb_stop_timer_start(uint8_t dev_id, uint64_t dur_us) { diff --git a/sdkconfig b/sdkconfig index a9c47c0f..31b3d772 100644 --- a/sdkconfig +++ b/sdkconfig @@ -155,6 +155,8 @@ CONFIG_BLUERETRO_SYSTEM_UNIVERSAL=y # CONFIG_BLUERETRO_BT_DISABLE is not set # CONFIG_BLUERETRO_BT_H4_TRACE is not set # CONFIG_BLUERETRO_GENERIC_HID_DEBUG is not set +# CONFIG_BLUERETRO_ADAPTER_INPUT_DBG is not set +# CONFIG_BLUERETRO_ADAPTER_INPUT_MAP_DBG is not set # CONFIG_BLUERETRO_WIRED_TRACE is not set # CONFIG_BLUERETRO_BT_TIMING_TESTS is not set # end of Debug