Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
fa519897
Commit
fa519897
authored
Sep 23, 2015
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Joystick: Fix magic numbers with integer overflow
parent
2b4453e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Joystick.cc
src/Joystick/Joystick.cc
+1
-1
JoystickConfigController.cc
src/VehicleSetup/JoystickConfigController.cc
+2
-2
No files found.
src/Joystick/Joystick.cc
View file @
fa519897
...
@@ -124,7 +124,7 @@ void Joystick::_loadSettings(void)
...
@@ -124,7 +124,7 @@ void Joystick::_loadSettings(void)
calibration
->
min
=
settings
.
value
(
minTpl
.
arg
(
axis
),
-
32768
).
toInt
(
&
convertOk
);
calibration
->
min
=
settings
.
value
(
minTpl
.
arg
(
axis
),
-
32768
).
toInt
(
&
convertOk
);
badSettings
|=
!
convertOk
;
badSettings
|=
!
convertOk
;
calibration
->
max
=
settings
.
value
(
maxTpl
.
arg
(
axis
),
3276
8
).
toInt
(
&
convertOk
);
calibration
->
max
=
settings
.
value
(
maxTpl
.
arg
(
axis
),
3276
7
).
toInt
(
&
convertOk
);
badSettings
|=
!
convertOk
;
badSettings
|=
!
convertOk
;
calibration
->
reversed
=
settings
.
value
(
revTpl
.
arg
(
axis
),
false
).
toBool
();
calibration
->
reversed
=
settings
.
value
(
revTpl
.
arg
(
axis
),
false
).
toBool
();
...
...
src/VehicleSetup/JoystickConfigController.cc
View file @
fa519897
...
@@ -32,9 +32,9 @@ QGC_LOGGING_CATEGORY(JoystickConfigControllerLog, "JoystickConfigControllerLog")
...
@@ -32,9 +32,9 @@ QGC_LOGGING_CATEGORY(JoystickConfigControllerLog, "JoystickConfigControllerLog")
const
int
JoystickConfigController
::
_updateInterval
=
150
;
///< Interval for timer which updates radio channel widgets
const
int
JoystickConfigController
::
_updateInterval
=
150
;
///< Interval for timer which updates radio channel widgets
const
int
JoystickConfigController
::
_calCenterPoint
=
0
;
const
int
JoystickConfigController
::
_calCenterPoint
=
0
;
const
int
JoystickConfigController
::
_calValidMinValue
=
-
32768
;
///< Largest valid minimum axis value
const
int
JoystickConfigController
::
_calValidMinValue
=
-
32768
;
///< Largest valid minimum axis value
const
int
JoystickConfigController
::
_calValidMaxValue
=
3276
8
;
///< Smallest valid maximum axis value
const
int
JoystickConfigController
::
_calValidMaxValue
=
3276
7
;
///< Smallest valid maximum axis value
const
int
JoystickConfigController
::
_calDefaultMinValue
=
-
32768
;
///< Default value for Min if not set
const
int
JoystickConfigController
::
_calDefaultMinValue
=
-
32768
;
///< Default value for Min if not set
const
int
JoystickConfigController
::
_calDefaultMaxValue
=
3276
8
;
///< Default value for Max if not set
const
int
JoystickConfigController
::
_calDefaultMaxValue
=
3276
7
;
///< Default value for Max if not set
const
int
JoystickConfigController
::
_calRoughCenterDelta
=
500
;
///< Delta around center point which is considered to be roughly centered
const
int
JoystickConfigController
::
_calRoughCenterDelta
=
500
;
///< Delta around center point which is considered to be roughly centered
const
int
JoystickConfigController
::
_calMoveDelta
=
32768
/
2
;
///< Amount of delta past center which is considered stick movement
const
int
JoystickConfigController
::
_calMoveDelta
=
32768
/
2
;
///< Amount of delta past center which is considered stick movement
const
int
JoystickConfigController
::
_calSettleDelta
=
100
;
///< Amount of delta which is considered no stick movement
const
int
JoystickConfigController
::
_calSettleDelta
=
100
;
///< Amount of delta which is considered no stick movement
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment