Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
9e8b1edb
Commit
9e8b1edb
authored
6 years ago
by
Kees Bakker
Browse files
Options
Downloads
Patches
Plain Diff
drivers/ads101x: eliminate casts
A helper variable is added, and now all type casts are not needed anymore.
parent
b77c802f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/ads101x/ads101x_saul.c
+5
-4
5 additions, 4 deletions
drivers/ads101x/ads101x_saul.c
with
5 additions
and
4 deletions
drivers/ads101x/ads101x_saul.c
+
5
−
4
View file @
9e8b1edb
...
@@ -33,18 +33,19 @@
...
@@ -33,18 +33,19 @@
static
int
read_adc
(
const
void
*
dev
,
phydat_t
*
res
)
static
int
read_adc
(
const
void
*
dev
,
phydat_t
*
res
)
{
{
const
ads101x_t
*
mydev
=
dev
;
/* Change the mux channel */
/* Change the mux channel */
ads101x_set_mux_gain
((
const
ads101x_t
*
)
dev
,
ads101x_set_mux_gain
(
mydev
,
mydev
->
params
.
mux_gain
);
((
ads101x_t
*
)
dev
)
->
params
.
mux_gain
);
/* Read raw value */
/* Read raw value */
if
(
ads101x_read_raw
(
(
const
ads101x_t
*
)
dev
,
res
->
val
)
<
0
)
{
if
(
ads101x_read_raw
(
my
dev
,
res
->
val
)
<
0
)
{
return
ECANCELED
;
return
ECANCELED
;
}
}
/* Special case for 2.048V */
/* Special case for 2.048V */
/* (this is the fixed FSR of ADS1013 and ADS1113) */
/* (this is the fixed FSR of ADS1013 and ADS1113) */
if
((
((
ads101x_t
*
)
dev
)
->
params
.
mux_gain
&
ADS101X_PGA_MASK
)
if
((
my
dev
->
params
.
mux_gain
&
ADS101X_PGA_MASK
)
==
ADS101X_PGA_FSR_2V048
)
{
==
ADS101X_PGA_FSR_2V048
)
{
/* LSB == 62.5uV to LSB == 100uV */
/* LSB == 62.5uV to LSB == 100uV */
...
...
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