Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds two simple functions for debugging.
Debugf works exactly like printf.
Debug takes an array of bytes and a length.
Example code on device:
Output on host:
Debugging is disabled by default. Both functions do nothing unless debugging in is enabled by uncommenting line 8 in debug.h (this should be done via make target at some point)
To try it uncomment line 8 in src/inc/debug.h and run "python debug.py" in the repository root. Then plug in the Nitrokey HSM. You should see this as soon as the device is done with the basic setup:
This code should have no side effects and be compatible with the master branch as well. As long as pyusb is installed it should work on every OS ('apt-get install python-usb'). More extensive documentation in debug.py and debug.h.
Don't use floating point math (that means don't print them either).