Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Libcoincellhell
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Klemm, Carl Philipp
Libcoincellhell
Commits
be64dbc8
Commit
be64dbc8
authored
1 year ago
by
Carl Philipp Klemm
Browse files
Options
Downloads
Patches
Plain Diff
Implement ramps
parent
5e3dc5ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
coincellhell.c
+23
-2
23 additions, 2 deletions
coincellhell.c
with
23 additions
and
2 deletions
coincellhell.c
+
23
−
2
View file @
be64dbc8
...
...
@@ -161,12 +161,33 @@ int coincellhell_check_ready(struct coincellhell* hell, bool* ready)
int
coincellhell_set_temperature_ramp
(
struct
coincellhell
*
hell
,
uint8_t
heater
,
time_t
end_time
,
float
temperature
)
{
time_t
currentTime
=
time
(
NULL
);
time_t
timeDelta
=
end_time
-
currentTime
;
if
(
timeDelta
<
0
)
return
-
1
;
char
buffer
[
7
];
buffer
[
0
]
=
heater
;
uint32_t
microTime
=
coincellhell_get_seconds
(
hell
);
uint32_t
*
endTime
=
(
uint32_t
*
)(
buffer
+
3
);
int16_t
*
setpoint
=
(
int16_t
*
)(
buffer
+
1
);
*
endTime
=
microTime
+
timeDelta
;
*
setpoint
=
temperature
/
10
.
0
f
;
int
ret
;
while
((
ret
=
usbshm_writeControlTransfer
(
hell
->
priv
,
COMMAND_HEATER_SETUP_RAMP
,
buffer
,
7
,
0
,
0
))
==
USBSHM_ERROR_AGAIN
)
usleep
(
100000
);
return
ret
;
}
int
coincellhell_cancle_ramp
(
struct
coincellhell
*
hell
,
uint8_t
heater
)
{
return
-
1
;
int
ret
;
while
((
ret
=
usbshm_writeControlTransfer
(
hell
->
priv
,
COMMAND_HEATER_RAMP_CANCLE
,
NULL
,
0
,
0
,
heater
))
==
USBSHM_ERROR_AGAIN
)
usleep
(
100000
);
return
ret
;
}
int
coincellhell_set_led
(
struct
coincellhell
*
hell
,
bool
on
)
...
...
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