mirror of
https://github.com/usatiuk/EggbotWireless.git
synced 2025-10-26 16:57:48 +01:00
17 lines
304 B
C++
17 lines
304 B
C++
#ifndef UTIL_H
|
|
#define UTIL_H
|
|
|
|
#include <Arduino.h>
|
|
|
|
constexpr int i2cFloatSize{4};
|
|
|
|
inline void bytesToFloat(float *target, byte *val) {
|
|
memcpy(target, val, i2cFloatSize);
|
|
return;
|
|
}
|
|
|
|
inline void floatToBytes(byte *target, float val) {
|
|
memcpy(target, &val, i2cFloatSize);
|
|
return;
|
|
}
|
|
#endif |