![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
xDotBridge/inc/util.h@100:0882cf295f8e, 2017-11-29 (annotated)
- Committer:
- mbriggs_vortex
- Date:
- Wed Nov 29 13:54:36 2017 -0700
- Revision:
- 100:0882cf295f8e
- Parent:
- 73:dc5adf462660
Adding relaese bin to repo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Matt Briggs | 73:dc5adf462660 | 1 | /* |
Matt Briggs | 73:dc5adf462660 | 2 | * util.h |
Matt Briggs | 73:dc5adf462660 | 3 | * |
Matt Briggs | 73:dc5adf462660 | 4 | * Created on: Mar 14, 2017 |
Matt Briggs | 73:dc5adf462660 | 5 | * Author: mbriggs |
Matt Briggs | 73:dc5adf462660 | 6 | */ |
Matt Briggs | 73:dc5adf462660 | 7 | |
Matt Briggs | 73:dc5adf462660 | 8 | #ifndef XDOTBRIDGE_INC_UTIL_H_ |
Matt Briggs | 73:dc5adf462660 | 9 | #define XDOTBRIDGE_INC_UTIL_H_ |
Matt Briggs | 73:dc5adf462660 | 10 | |
Matt Briggs | 73:dc5adf462660 | 11 | #include <vector> |
Matt Briggs | 73:dc5adf462660 | 12 | |
Matt Briggs | 73:dc5adf462660 | 13 | void appendUint16ToVector (std::vector<uint8_t> &dest, uint16_t in) |
Matt Briggs | 73:dc5adf462660 | 14 | { |
Matt Briggs | 73:dc5adf462660 | 15 | dest.push_back((in & 0xFF00) >> 8); // High data byte |
Matt Briggs | 73:dc5adf462660 | 16 | dest.push_back((in & 0x00FF)); // Low data byte |
Matt Briggs | 73:dc5adf462660 | 17 | } |
Matt Briggs | 73:dc5adf462660 | 18 | void appendUint32ToVector (std::vector<uint8_t> &dest, uint32_t in) |
Matt Briggs | 73:dc5adf462660 | 19 | { |
Matt Briggs | 73:dc5adf462660 | 20 | dest.push_back((in & 0xFF000000) >> 24); |
Matt Briggs | 73:dc5adf462660 | 21 | dest.push_back((in & 0x00FF0000) >> 16); |
Matt Briggs | 73:dc5adf462660 | 22 | dest.push_back((in & 0x0000FF00) >> 8); |
Matt Briggs | 73:dc5adf462660 | 23 | dest.push_back((in & 0x000000FF)); |
Matt Briggs | 73:dc5adf462660 | 24 | } |
Matt Briggs | 73:dc5adf462660 | 25 | |
Matt Briggs | 73:dc5adf462660 | 26 | |
Matt Briggs | 73:dc5adf462660 | 27 | |
Matt Briggs | 73:dc5adf462660 | 28 | #endif /* XDOTBRIDGE_INC_UTIL_H_ */ |