diff --git a/Inc/common_defines.h b/Inc/common_defines.h index 25ee613..76429ce 100644 --- a/Inc/common_defines.h +++ b/Inc/common_defines.h @@ -11,7 +11,7 @@ //#define DEBUG -#define FIRMWARE_VERSION 0x1342 // v1.3.4b2 +#define FIRMWARE_VERSION 0x1343 // v1.3.4b3 #define USED_PINS_NUM 30 // constant for BluePill and BlackPill boards #define MAX_AXIS_NUM 8 // max 8 #define MAX_BUTTONS_NUM 128 // power of 2, max 128 diff --git a/Inc/main.h b/Inc/main.h index 69287cf..a6ee54f 100644 --- a/Inc/main.h +++ b/Inc/main.h @@ -18,7 +18,7 @@ static const dev_config_t init_config = { - .firmware_version = 0x1342, // do not change + .firmware_version = 0x1343, // do not change /* Name of device in devices dispatcher diff --git a/MDK-ARM/FreeJoy.bin b/MDK-ARM/FreeJoy.bin index 6a7db9a..6dc25ed 100644 Binary files a/MDK-ARM/FreeJoy.bin and b/MDK-ARM/FreeJoy.bin differ diff --git a/Src/analog.c b/Src/analog.c index 6c423cf..28547ae 100644 --- a/Src/analog.c +++ b/Src/analog.c @@ -475,9 +475,9 @@ void AxesProcess (dev_config_t * p_dev_config) axes_buttons[i][0].current_state = buttons_state[p_dev_config->axis_config[i].decrement_button].current_state; axes_buttons[i][1].current_state = buttons_state[p_dev_config->axis_config[i].increment_button].current_state; - axes_buttons[i][2].current_state = buttons_state[p_dev_config->axis_config[i].center_button].current_state; + axes_buttons[i][2].current_state = buttons_state[p_dev_config->axis_config[i].center_button].current_state; - // decrement + // decrement if (axes_buttons[i][0].current_state && !axes_buttons[i][0].prev_state) { tmp32 -= AXIS_FULLSCALE * p_dev_config->axis_config[i].step / 255; @@ -500,7 +500,7 @@ void AxesProcess (dev_config_t * p_dev_config) } // center - if (axes_buttons[i][2].current_state && !axes_buttons[i][2].prev_state) + if (axes_buttons[i][2].current_state) { tmp32 = AXIS_CENTER_VALUE; } diff --git a/Src/buttons.c b/Src/buttons.c index e9b8c9f..7ab3161 100644 --- a/Src/buttons.c +++ b/Src/buttons.c @@ -717,7 +717,7 @@ void ButtonsReadLogical (dev_config_t * p_dev_config) // prevent not atomic read NVIC_DisableIRQ(TIM1_UP_IRQn); - buttons_data[(i & 0xF8)>>3] &= ~(1 << (i & 0x07)); + buttons_data[(k & 0xF8)>>3] &= ~(1 << (k & 0x07)); buttons_data[(k & 0xF8)>>3] |= (buttons_state[i].current_state << (k & 0x07)); k++;