RoboidControl-cpp/ControlCore/LowLevelMessages.cpp
2024-12-11 18:01:06 +01:00

12 lines
344 B
C++

#include "LowLevelMessages.h"
#include "../float16/float16.h"
void LowLevelMessages::SendFloat16(unsigned char *buffer, unsigned char *ix,
float value) {
float16 value16 = float16(value);
short binary = value16.getBinary();
buffer[(*ix)++] = (binary >> 8) & 0xFF;
buffer[(*ix)++] = binary & 0xFF;
}