press and release timings

This commit is contained in:
Denis 2023-11-20 00:22:37 +01:00
parent 82dbbab448
commit da0c1bc35f
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03
2 changed files with 3 additions and 1 deletions

View file

@ -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;

View file

@ -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 {