Fork to see if I can get working

Dependencies:   BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated

Fork of xDotBridge_update_test20180823 by Matt Briggs

xDotBridge/inc/util.h

Committer:
mbriggs_vortex
Date:
2017-11-29
Revision:
100:0882cf295f8e
Parent:
73:dc5adf462660

File content as of revision 100:0882cf295f8e:

/*
 * util.h
 *
 *  Created on: Mar 14, 2017
 *      Author: mbriggs
 */

#ifndef XDOTBRIDGE_INC_UTIL_H_
#define XDOTBRIDGE_INC_UTIL_H_

#include <vector>

void appendUint16ToVector (std::vector<uint8_t> &dest, uint16_t in)
{
    dest.push_back((in & 0xFF00) >> 8); // High data byte
    dest.push_back((in & 0x00FF)); // Low data byte
}
void appendUint32ToVector (std::vector<uint8_t> &dest, uint32_t in)
{
    dest.push_back((in & 0xFF000000) >> 24);
    dest.push_back((in & 0x00FF0000) >> 16);
    dest.push_back((in & 0x0000FF00) >> 8);
    dest.push_back((in & 0x000000FF));
}



#endif /* XDOTBRIDGE_INC_UTIL_H_ */