diff --git a/Inc/common_defines.h b/Inc/common_defines.h index dbc2fa2..82b0a5e 100644 --- a/Inc/common_defines.h +++ b/Inc/common_defines.h @@ -11,7 +11,7 @@ //#define DEBUG -#define FIRMWARE_VERSION 0x1516 // v1.5.1b6 +#define FIRMWARE_VERSION 0x1517 // v1.5.1b7 #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 2e01955..933f17a 100644 --- a/Inc/main.h +++ b/Inc/main.h @@ -18,7 +18,7 @@ static const dev_config_t init_config = { - .firmware_version = 0x1516, // do not change + .firmware_version = 0x1517, // do not change /* Name of device in devices dispatcher diff --git a/MDK-ARM/FreeJoy.bin b/MDK-ARM/FreeJoy.bin index 978baf1..126582c 100644 Binary files a/MDK-ARM/FreeJoy.bin and b/MDK-ARM/FreeJoy.bin differ diff --git a/MDK-ARM/FreeJoy.uvoptx b/MDK-ARM/FreeJoy.uvoptx index a58efa2..3a4dbf9 100644 --- a/MDK-ARM/FreeJoy.uvoptx +++ b/MDK-ARM/FreeJoy.uvoptx @@ -148,7 +148,24 @@ UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM)) - + + + 0 + 0 + 80 + 1 +
134246376
+ 0 + 0 + 0 + 0 + 0 + 1 + ../Src/main.c + + \\FreeJoy\../Src/main.c\80 +
+
0 @@ -205,6 +222,11 @@ 1 shift_registers,0x0A + + 11 + 1 + leds_state + 0 @@ -248,6 +270,12 @@ + + + System Viewer\GPIOB + 35905 + + 1 1 @@ -594,6 +622,22 @@ + + 13 + 0 + 80 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ../Src/main.c + + +
diff --git a/Src/leds.c b/Src/leds.c index 55c633b..93097f8 100644 --- a/Src/leds.c +++ b/Src/leds.c @@ -54,7 +54,14 @@ void LED_SetSingle(uint8_t * state_buf, dev_config_t * p_dev_config, uint8_t * p { if (p_dev_config->pins[i] == LED_SINGLE) { - leds_state[(*pos)] ? (pin_config[i].port->ODR |= pin_config[i].pin) : (pin_config[i].port->ODR &= !pin_config[i].pin); + if (leds_state[*pos]) + { + pin_config[i].port->ODR |= pin_config[i].pin; + } + else + { + pin_config[i].port->ODR &= ~pin_config[i].pin; + } (*pos)++; } } diff --git a/Src/stm32f10x_it.c b/Src/stm32f10x_it.c index ddfe1fd..817923e 100644 --- a/Src/stm32f10x_it.c +++ b/Src/stm32f10x_it.c @@ -173,7 +173,7 @@ void SysTick_Handler(void) void TIM1_UP_IRQHandler(void) { - uint8_t btn_num = 0; + static uint8_t btn_num = 0; uint8_t physical_buttons_data[MAX_BUTTONS_NUM]; joy_report_t joy_report;