Skip to content

Instantly share code, notes, and snippets.

@jdiez17
Created June 17, 2016 11:12
Show Gist options
  • Save jdiez17/9fa18a3c3f3932964f0f395e014b2861 to your computer and use it in GitHub Desktop.
Save jdiez17/9fa18a3c3f3932964f0f395e014b2861 to your computer and use it in GitHub Desktop.
static float decode_float(const uint8_t *data) {
float f;
uint8_t bytes[] = {data[3], data[2], data[1], data[0]};
memcpy(&f, bytes, 4);
return f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment