From 98ba8de7805614166ca1150bd6cd5e11eaa82ed8 Mon Sep 17 00:00:00 2001 From: CrazyRedMachine Date: Sun, 3 Sep 2023 18:10:11 +0200 Subject: [PATCH] test enhanced_polling_nb_iter --- popnhax/config.h | 1 + popnhax/dllmain.cc | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/popnhax/config.h b/popnhax/config.h index cffd827..aecec81 100644 --- a/popnhax/config.h +++ b/popnhax/config.h @@ -44,6 +44,7 @@ struct popnhax_config { uint8_t debounce; bool enhanced_polling_stats; int8_t enhanced_polling_priority; + uint32_t enhanced_polling_nb_iter; uint8_t hispeed_auto; uint16_t hispeed_default_bpm; uint8_t survival_gauge; diff --git a/popnhax/dllmain.cc b/popnhax/dllmain.cc index e065a46..8209a15 100644 --- a/popnhax/dllmain.cc +++ b/popnhax/dllmain.cc @@ -166,6 +166,8 @@ PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_BOOL, struct popnhax_config, translation_de "/popnhax/translation_debug") PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_BOOL, struct popnhax_config, enhanced_polling, "/popnhax/enhanced_polling") +PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_U32, struct popnhax_config, enhanced_polling_nb_iter, + "/popnhax/enhanced_polling_nb_iter") PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_U8, struct popnhax_config, debounce, "/popnhax/debounce") PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_BOOL, struct popnhax_config, enhanced_polling_stats, @@ -2205,10 +2207,10 @@ int (*usbPadRead)(uint32_t*); #pragma GCC push_options #pragma GCC optimize ("O0") -static void __inline wait_a_little() +static void __inline wait_a_little(uint32_t nb_iter) { - int j=0; - for (int i=0; i<450000; i++) + uint32_t j=0; + for (uint32_t i=0; i