Skip to content

Commit

Permalink
Fixed button operation when shift exists but not pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Vostrenkov committed Jun 23, 2020
1 parent a2563be commit bed2167
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 16 deletions.
Binary file modified MDK-ARM/FreeJoy.bin
Binary file not shown.
53 changes: 41 additions & 12 deletions MDK-ARM/FreeJoy.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,24 @@
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM))</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>704</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134236764</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\application\Src\buttons.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\FreeJoy\../application/Src/buttons.c\704</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
Expand Down Expand Up @@ -220,6 +237,11 @@
<WinNumber>1</WinNumber>
<ItemText>raw_buttons</ItemText>
</Ww>
<Ww>
<count>13</count>
<WinNumber>1</WinNumber>
<ItemText>shifts_state</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
Expand Down Expand Up @@ -279,16 +301,6 @@
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<SystemViewers>
<Entry>
<Name>System Viewer\GPIOA</Name>
<WinId>35905</WinId>
</Entry>
<Entry>
<Name>System Viewer\USB</Name>
<WinId>35904</WinId>
</Entry>
</SystemViewers>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>1</EnableFlashSeq>
Expand Down Expand Up @@ -431,7 +443,24 @@
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM))</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>704</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>..\application\Src\buttons.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
Expand Down
2 changes: 1 addition & 1 deletion MDK-ARM/FreeJoy.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>1</Optim>
<Optim>4</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
Expand Down
2 changes: 1 addition & 1 deletion application/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

static const dev_config_t init_config =
{
.firmware_version = 0x1605, // do not change
.firmware_version = 0x1606, // do not change

/*
Name of device in devices dispatcher
Expand Down
2 changes: 1 addition & 1 deletion application/Src/buttons.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ void ButtonsReadLogical (dev_config_t * p_dev_config)
(p_dev_config->buttons[j].shift_modificator) == 0)
{
logical_buttons_state[j].prev_physical_state = logical_buttons_state[j].curr_physical_state;
logical_buttons_state[j].curr_physical_state = physical_buttons_state[p_dev_config->buttons[i].physical_num].current_state;
logical_buttons_state[j].curr_physical_state = physical_buttons_state[p_dev_config->buttons[j].physical_num].current_state;

LogicalButtonProcessState(&logical_buttons_state[j], pov_pos, p_dev_config, j);
}
Expand Down
2 changes: 1 addition & 1 deletion common_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

//#define DEBUG

#define FIRMWARE_VERSION 0x1605 // v1.6.0b5
#define FIRMWARE_VERSION 0x1606 // v1.6.0b6
#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
Expand Down

0 comments on commit bed2167

Please sign in to comment.