![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Same version struct used for 3600 boot image. More...
#include <Version.h>
Public Member Functions | |
| version_t (uint16_t maj, uint16_t min, uint16_t rev) | |
| version_t (const std::string &versionString) | |
| void | set (const std::string &versionString) |
| Sets the version by parsing a string. More... | |
| void | fixByteOrder () |
| Converts host endian BCD version values to the equivalent big-endian BCD values. More... | |
Public Attributes | |
| uint16_t | m_major |
| uint16_t | m_pad0 |
| uint16_t | m_minor |
| uint16_t | m_pad1 |
| uint16_t | m_revision |
| uint16_t | m_pad2 |
Same version struct used for 3600 boot image.
| void version_t::fixByteOrder | ( | ) |
Converts host endian BCD version values to the equivalent big-endian BCD values.
The output is a half-word. And BCD is inherently big-endian, or byte ordered, if you prefer to think of it that way. So for little endian systems, we need to convert the output half-word in reverse byte order. When it is written to disk or a buffer it will come out big endian.
For example:
On big endian hosts, we don't have to worry about byte swapping.
| void version_t::set | ( | const std::string & | versionString | ) |
Sets the version by parsing a string.
Parses a string in the form "xxx.xxx.xxx" (where x is a digit) into three version fields for major, minor, and revision. The output is right aligned BCD in host-natural byte order.
| versionString | String containing the version. |