Skip to content

Commit

Permalink
Fixed lower and upper calibration limits
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Vostrenkov committed Jan 10, 2020
2 parents 283bc44 + c23437d commit 1cd861a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Binary file modified MDK-ARM/FreeJoy.bin
Binary file not shown.
5 changes: 5 additions & 0 deletions MDK-ARM/FreeJoy.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@
<WinNumber>1</WinNumber>
<ItemText>USBD_SERIALNUMBER_STRING_FS</ItemText>
</Ww>
<Ww>
<count>11</count>
<WinNumber>1</WinNumber>
<ItemText>tmp16,0x0A</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
Expand Down
Binary file removed MDK-ARM/FreeJoy_v1_01b2.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions Src/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ static uint32_t map2( uint32_t x,
tmp8 = x;


if (tmp8 < in_min) return in_min;
if (tmp8 > in_max) return in_max;
if (tmp8 < in_min) return out_min;
if (tmp8 > in_max) return out_max;

ret = (tmp8 - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;

Expand All @@ -65,8 +65,8 @@ static uint32_t map3( uint32_t x,
tmp8 = x;


if (tmp8 < in_min) return in_min;
if (tmp8 > in_max) return in_max;
if (tmp8 < in_min) return out_min;
if (tmp8 > in_max) return out_max;

if (tmp8 < in_center)
{
Expand Down

0 comments on commit 1cd861a

Please sign in to comment.