Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
e7f774c9
Commit
e7f774c9
authored
3 months ago
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
captouch: linearized bottom petal pos a bit
parent
cde04346
No related branches found
No related tags found
1 merge request
!735
various bugfixes
Pipeline
#13258
passed
3 months ago
Stage: check
Stage: build
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/flow3r_bsp/flow3r_bsp_ad7147.c
+24
-3
24 additions, 3 deletions
components/flow3r_bsp/flow3r_bsp_ad7147.c
with
24 additions
and
3 deletions
components/flow3r_bsp/flow3r_bsp_ad7147.c
+
24
−
3
View file @
e7f774c9
...
...
@@ -1401,6 +1401,16 @@ static inline void pos_calc_bot(int index, int mode, int *rad, int *raw_sum,
int
rad_calc
=
tip
-
base
;
rad_calc
*=
petal_pos_gain
[
index
];
rad_calc
/=
((
tip
+
base
)
>>
2
)
+
1
;
rad_calc
=
16384
-
rad_calc
;
int
rad_calc_gain
=
rad_calc
>
0
?
rad_calc
:
0
;
rad_calc_gain
=
(
rad_calc_gain
+
32768
)
>>
5
;
rad_calc_gain
=
(
rad_calc_gain
*
rad_calc_gain
)
>>
12
;
rad_calc
=
(
rad_calc
*
rad_calc_gain
)
>>
10
;
rad_calc
=
16384
-
rad_calc
;
*
rad
=
rad_calc
;
}
else
{
*
rad
=
0
;
...
...
@@ -1435,9 +1445,20 @@ static inline void pos_calc_top2(int index, int mode, int *rad, int *phi,
}
}
static
void
pos_calc_bot2
(
int
index
,
int
mode
,
int
*
rad
,
int
*
raw_sum
,
uint16_t
*
raw_petal
)
{
pos_calc_bot
(
index
,
mode
,
rad
,
raw_sum
,
raw_petal
);
static
inline
void
pos_calc_bot2
(
int
index
,
int
mode
,
int
*
rad
,
int
*
raw_sum
,
uint16_t
*
raw_petal
)
{
int32_t
tip
=
raw_petal
[
petal_pad_tip
];
int32_t
base
=
raw_petal
[
petal_pad_base
];
*
raw_sum
=
base
+
tip
;
if
(
mode
>
1
)
{
base
+=
((
base
*
3
)
>>
2
);
// tiny gain correction
int
rad_calc
=
tip
-
base
;
rad_calc
*=
petal_pos_gain
[
index
];
rad_calc
/=
((
tip
+
base
)
>>
2
)
+
1
;
*
rad
=
rad_calc
;
}
else
{
*
rad
=
0
;
}
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment