-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from davidgiven/fixing1
Add support for measuring signal line voltages.
- Loading branch information
Showing
12 changed files
with
967 additions
and
323 deletions.
There are no files selected for viewing
584 changes: 292 additions & 292 deletions
584
FluxEngine.cydsn/CortexM3/ARM_GCC_541/Release/FluxEngine.hex
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "globals.h" | ||
#include "flags.h" | ||
#include "usb.h" | ||
#include "protocol.h" | ||
#include <fmt/format.h> | ||
|
||
static FlagGroup flags; | ||
|
||
static std::string display_voltages(struct voltages& v) | ||
{ | ||
return fmt::format( | ||
" Logic 1 / 0: {:.2f}V / {:.2f}V\n", | ||
v.logic0_mv / 1000.0, | ||
v.logic1_mv / 1000.0); | ||
} | ||
|
||
int mainTestVoltages(int argc, const char* argv[]) | ||
{ | ||
flags.parseFlags(argc, argv); | ||
struct voltages_frame f; | ||
usbMeasureVoltages(&f); | ||
|
||
std::cout << "Output voltages:\n" | ||
<< " Both drives deselected\n" | ||
<< display_voltages(f.output_both_off) | ||
<< " Drive 0 selected\n" | ||
<< display_voltages(f.output_drive_0_selected) | ||
<< " Drive 1 selected\n" | ||
<< display_voltages(f.output_drive_1_selected) | ||
<< " Drive 0 running\n" | ||
<< display_voltages(f.output_drive_0_running) | ||
<< " Drive 1 running\n" | ||
<< display_voltages(f.output_drive_1_running) | ||
<< "Input voltages:\n" | ||
<< " Both drives deselected\n" | ||
<< display_voltages(f.input_both_off) | ||
<< " Drive 0 selected\n" | ||
<< display_voltages(f.input_drive_0_selected) | ||
<< " Drive 1 selected\n" | ||
<< display_voltages(f.input_drive_1_selected) | ||
<< " Drive 0 running\n" | ||
<< display_voltages(f.input_drive_0_running) | ||
<< " Drive 1 running\n" | ||
<< display_voltages(f.input_drive_1_running); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.