Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
7864b133
Commit
7864b133
authored
Jun 10, 2017
by
Dave Johnson
Browse files
Options
Downloads
Patches
Plain Diff
Fix get/setDrvPct declarations
parent
0b6b7c9c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/dac_mcp4728.cpp
+2
-2
2 additions, 2 deletions
Marlin/dac_mcp4728.cpp
Marlin/dac_mcp4728.h
+2
-2
2 additions, 2 deletions
Marlin/dac_mcp4728.h
with
4 additions
and
4 deletions
Marlin/dac_mcp4728.cpp
+
2
−
2
View file @
7864b133
...
@@ -114,13 +114,13 @@ uint16_t mcp4728_getVout(uint8_t channel) {
...
@@ -114,13 +114,13 @@ uint16_t mcp4728_getVout(uint8_t channel) {
/**
/**
* Returns DAC values as a 0-100 percentage of drive strength
* Returns DAC values as a 0-100 percentage of drive strength
*/
*/
uint
16
_t
mcp4728_getDrvPct
(
uint8_t
channel
)
{
return
uint
16
_t
(
100.0
*
mcp4728_values
[
channel
]
/
(
DAC_STEPPER_MAX
)
+
0.5
);
}
uint
8
_t
mcp4728_getDrvPct
(
uint8_t
channel
)
{
return
uint
8
_t
(
100.0
*
mcp4728_values
[
channel
]
/
(
DAC_STEPPER_MAX
)
+
0.5
);
}
/**
/**
* Receives all Drive strengths as 0-100 percent values, updates
* Receives all Drive strengths as 0-100 percent values, updates
* DAC Values array and calls fastwrite to update the DAC.
* DAC Values array and calls fastwrite to update the DAC.
*/
*/
void
mcp4728_setDrvPct
(
uint
16
_t
pct
[
XYZE
])
{
void
mcp4728_setDrvPct
(
uint
8
_t
pct
[
XYZE
])
{
LOOP_XYZE
(
i
)
mcp4728_values
[
i
]
=
0.01
*
pct
[
i
]
*
(
DAC_STEPPER_MAX
);
LOOP_XYZE
(
i
)
mcp4728_values
[
i
]
=
0.01
*
pct
[
i
]
*
(
DAC_STEPPER_MAX
);
mcp4728_fastWrite
();
mcp4728_fastWrite
();
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
Marlin/dac_mcp4728.h
+
2
−
2
View file @
7864b133
...
@@ -59,8 +59,8 @@ uint8_t mcp4728_setGain_all(uint8_t value);
...
@@ -59,8 +59,8 @@ uint8_t mcp4728_setGain_all(uint8_t value);
uint16_t
mcp4728_getValue
(
uint8_t
channel
);
uint16_t
mcp4728_getValue
(
uint8_t
channel
);
uint8_t
mcp4728_fastWrite
();
uint8_t
mcp4728_fastWrite
();
uint8_t
mcp4728_simpleCommand
(
byte
simpleCommand
);
uint8_t
mcp4728_simpleCommand
(
byte
simpleCommand
);
uint
16
_t
mcp4728_getDrvPct
(
uint8_t
channel
);
uint
8
_t
mcp4728_getDrvPct
(
uint8_t
channel
);
void
mcp4728_setDrvPct
(
uint
16
_t
pct
[
XYZE
]);
void
mcp4728_setDrvPct
(
uint
8
_t
pct
[
XYZE
]);
#endif
#endif
#endif // DAC_MCP4728_H
#endif // DAC_MCP4728_H
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