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
49fd261e
Commit
49fd261e
authored
1 year ago
by
Carl Philipp Klemm
Browse files
Options
Downloads
Patches
Plain Diff
add support for reseting the usb bus
parent
b56c003f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
coincellhell.c
+5
-0
5 additions, 0 deletions
coincellhell.c
coincellhell/coincellhell.h
+1
-0
1 addition, 0 deletions
coincellhell/coincellhell.h
main.c
+6
-0
6 additions, 0 deletions
main.c
with
12 additions
and
0 deletions
coincellhell.c
+
5
−
0
View file @
49fd261e
...
@@ -317,6 +317,11 @@ int coincellhell_set_periodic_recal(struct coincellhell* hell, bool recal)
...
@@ -317,6 +317,11 @@ int coincellhell_set_periodic_recal(struct coincellhell* hell, bool recal)
return
ret
;
return
ret
;
}
}
void
coincellhell_reset_bus
(
struct
coincellhell
*
hell
)
{
usbshm_reset
(
hell
->
priv
);
}
void
coincellhell_disconnect
(
struct
coincellhell
*
hell
)
void
coincellhell_disconnect
(
struct
coincellhell
*
hell
)
{
{
if
(
!
hell
||
!
hell
->
priv
)
if
(
!
hell
||
!
hell
->
priv
)
...
...
This diff is collapsed.
Click to expand it.
coincellhell/coincellhell.h
+
1
−
0
View file @
49fd261e
...
@@ -178,6 +178,7 @@ uint32_t coincellhell_get_seconds(struct coincellhell* hell);
...
@@ -178,6 +178,7 @@ uint32_t coincellhell_get_seconds(struct coincellhell* hell);
const
uint8_t
*
coincellhell_get_fw_git_revision
(
struct
coincellhell
*
hell
);
const
uint8_t
*
coincellhell_get_fw_git_revision
(
struct
coincellhell
*
hell
);
int
coincellhell_enable_watchdog
(
struct
coincellhell
*
hell
);
int
coincellhell_enable_watchdog
(
struct
coincellhell
*
hell
);
int
coincellhell_set_periodic_recal
(
struct
coincellhell
*
hell
,
bool
recal
);
int
coincellhell_set_periodic_recal
(
struct
coincellhell
*
hell
,
bool
recal
);
void
coincellhell_reset_bus
(
struct
coincellhell
*
hell
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
This diff is collapsed.
Click to expand it.
main.c
+
6
−
0
View file @
49fd261e
...
@@ -52,6 +52,7 @@ static void print_commands(void)
...
@@ -52,6 +52,7 @@ static void print_commands(void)
puts
(
"git
\t\t\t
| get the git revision of the firmware on the device"
);
puts
(
"git
\t\t\t
| get the git revision of the firmware on the device"
);
puts
(
"watchdog
\t\t\t
| enables the on device command watchdog"
);
puts
(
"watchdog
\t\t\t
| enables the on device command watchdog"
);
puts
(
"recal [BOOLEAN]
\t\t
| enables or disables periodic recal"
);
puts
(
"recal [BOOLEAN]
\t\t
| enables or disables periodic recal"
);
puts
(
"reset
\t\t\t
| reset the usb bus of this device"
);
}
}
static
int
convert_string_to_heater_id
(
const
char
*
str
)
static
int
convert_string_to_heater_id
(
const
char
*
str
)
...
@@ -367,6 +368,11 @@ static int process_commands(char** commands, size_t command_count, struct coince
...
@@ -367,6 +368,11 @@ static int process_commands(char** commands, size_t command_count, struct coince
if
(
ret
<
0
)
if
(
ret
<
0
)
puts
(
"could not enable watchdog"
);
puts
(
"could not enable watchdog"
);
}
}
else
if
(
strcmp
(
commands
[
0
],
"reset"
)
==
0
)
{
coincellhell_reset_bus
(
hell
);
ret
=
0
;
}
else
else
{
{
printf
(
"%s is not a valid command!"
,
commands
[
0
]);
printf
(
"%s is not a valid command!"
,
commands
[
0
]);
...
...
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