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
c864a09f
Commit
c864a09f
authored
1 year ago
by
Carl Philipp Klemm
Browse files
Options
Downloads
Patches
Plain Diff
Add support for the new fault type value
parent
d2647464
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
coincellhell.c
+21
-0
21 additions, 0 deletions
coincellhell.c
coincellhell/coincellhell.h
+9
-0
9 additions, 0 deletions
coincellhell/coincellhell.h
coincellhell/usbcommands.h
+9
-0
9 additions, 0 deletions
coincellhell/usbcommands.h
with
39 additions
and
0 deletions
coincellhell.c
+
21
−
0
View file @
c864a09f
...
...
@@ -117,6 +117,7 @@ int coincellhell_get_state(struct coincellhell* hell, uint8_t heater, struct hea
state
->
ready
=
buf
[
0
]
&
(
1
<<
1
);
state
->
ramp
=
buf
[
0
]
&
(
1
<<
2
);
state
->
fault
=
buf
[
0
]
&
(
1
<<
3
);
state
->
faultType
=
buf
[
6
];
state
->
setpoint
=
*
setpoint
/
10
.
0
f
;
state
->
rampTarget
=
*
rampTarget
/
10
.
0
f
;
...
...
@@ -234,3 +235,23 @@ void coincellhell_disconnect(struct coincellhell* hell)
hell
->
priv
=
NULL
;
}
const
char
*
coincellhell_string_for_fault
(
fault_t
fault
)
{
switch
(
fault
)
{
case
FAULT_NONE
:
return
"no fault detected"
;
case
FAULT_FRONT_SENSOR
:
return
"unable to read from front sensor"
;
case
FAULT_SIDE_SENSOR
:
return
"unable to read from side sensor"
;
case
FAULT_OVERTEMP
:
return
"system shutdown due to a overtemperature event"
;
case
FAULT_UNDERTEMP
:
return
"system shutdown due to a undertemperature event"
;
case
FAULT_UNSPECIFIED
:
default:
return
"a unspecified fault occured"
;
}
}
This diff is collapsed.
Click to expand it.
coincellhell/coincellhell.h
+
9
−
0
View file @
c864a09f
...
...
@@ -59,6 +59,8 @@ struct heater_state
bool
ramp
;
/** true if the system has detected a fault with this heater*/
bool
fault
;
/** the detected fault type as a fault_t enum*/
fault_t
faultType
;
/** current command (0-255) that is being sent to the dac for this heater*/
uint8_t
dacCommand
;
/** current target temperature for this heater*/
...
...
@@ -156,6 +158,13 @@ int coincellhell_set_led(struct coincellhell* hell, bool on);
*/
void
coincellhell_disconnect
(
struct
coincellhell
*
hell
);
/**
* @brief Returns a human readable string for a given fault.
* @param fault the fault code
* @return a const string describeing the fault
*/
const
char
*
coincellhell_string_for_fault
(
fault_t
fault
);
int
coincellhell_write_eeprom
(
struct
coincellhell
*
hell
,
uint16_t
addr
,
uint16_t
value
);
uint16_t
coincellhell_read_eeprom
(
struct
coincellhell
*
hell
,
uint16_t
addr
);
uint8_t
coincellhell_read_oscal
(
struct
coincellhell
*
hell
);
...
...
This diff is collapsed.
Click to expand it.
coincellhell/usbcommands.h
+
9
−
0
View file @
c864a09f
...
...
@@ -31,6 +31,15 @@ typedef enum {
TEMP_LOCATION_INVALID
,
}
temperature_sensor_location_t
;
typedef
enum
{
FAULT_NONE
=
0
,
FAULT_FRONT_SENSOR
,
FAULT_SIDE_SENSOR
,
FAULT_OVERTEMP
,
FAULT_UNDERTEMP
,
FAULT_UNSPECIFIED
}
fault_t
;
/*
* @}
*/
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