diff --git a/logic.c b/logic.c index aa83268..ea6c993 100644 --- a/logic.c +++ b/logic.c @@ -76,7 +76,7 @@ int logic_copy_gamepad_status(logic_t *const logic, gamepad_status_t *const out) if (logic->gamepad.center) { // If the center button is pressed and at least 500ms have passed - if (elapsed_time >= 500) { + if (elapsed_time >= PRESS_AND_RELEASE_DURATION_FOR_CENTER_BUTTON_MS) { printf("Releasing center button\n"); logic->gamepad.center = 0; logic->gamepad.flags &= ~GAMEPAD_STATUS_FLAGS_PRESS_AND_REALEASE_CENTER; diff --git a/logic.h b/logic.h index 8d7cb4c..43b99b3 100644 --- a/logic.h +++ b/logic.h @@ -3,6 +3,8 @@ #include "platform.h" #include "queue.h" +#define PRESS_AND_RELEASE_DURATION_FOR_CENTER_BUTTON_MS 200 + #define GAMEPAD_STATUS_FLAGS_PRESS_AND_REALEASE_CENTER 0x00000001U typedef struct gamepad_status {