Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT WIC Gateware
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
DIOT WIC Gateware
Commits
42ea30b1
Commit
42ea30b1
authored
Nov 28, 2018
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed interpretation of voltage status bits
parent
f3b96b13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
diot_crate.cpp
sw/diot-sw/gui_demo/diot_crate.cpp
+0
-7
diot_crate.h
sw/diot-sw/gui_demo/diot_crate.h
+8
-4
No files found.
sw/diot-sw/gui_demo/diot_crate.cpp
View file @
42ea30b1
...
...
@@ -99,13 +99,6 @@ int DIOT_Crate::GetTemp(unsigned int sensor)
}
bool
DIOT_Crate
::
GetVoltStatus
(
VOLTAGE
volt
)
{
// status bit == 1 indicates failure, hence negation
return
!
(
GetVoltStatusAll
()
&
volt
);
}
std
::
string
DIOT_Crate
::
GetVoltName
(
VOLTAGE
volt
)
{
for
(
const
auto
&
volt_pair
:
VOLTAGES
)
{
...
...
sw/diot-sw/gui_demo/diot_crate.h
View file @
42ea30b1
...
...
@@ -176,13 +176,14 @@ public:
P5V0
=
0x02
,
P12V0
=
0x04
,
M12V0
=
0x08
,
GOOD
=
0x0f
,
///< Value describing all voltages valid
INVALID
=
0xff
};
/**
* Return power supply status.
* @return
0 when all voltages are correct, else check which bits are
*
asserted
to determine faulty voltages.
* @return
VOLTAGE::GOOD when all voltages are correct, else check which
*
bits are reset
to determine faulty voltages.
* @see VOLTAGE
*/
int
GetVoltStatusAll
()
...
...
@@ -191,11 +192,14 @@ public:
}
/**
* Return status of a particular vo
tl
age.
* Return status of a particular vo
lt
age.
* @param volt is the checked voltage.
* @return True when voltage is correct, false otherwise.
*/
bool
GetVoltStatus
(
VOLTAGE
volt
);
bool
GetVoltStatus
(
VOLTAGE
volt
)
{
return
GetVoltStatusAll
()
&
volt
;
}
/**
* Return vector of available voltage enums and their descriptions.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment