Skip to content
Snippets Groups Projects
Commit efdb2727 authored by dawehr's avatar dawehr
Browse files

Fixed a bug in cb_getcontrol.

I was not copying the float value into the array correctly.
Hopefully I have it right now... will check with eric when he gets back from making tea.
parent 9c09e1eb
No related branches found
No related tags found
No related merge requests found
......@@ -214,13 +214,10 @@ int cb_getcontrol(modular_structs_t* structs)
// Controller value ID
resp_data[1] = controller_value_id;
// Controller value (4 byte float)
resp_data[2] = (controller_value) & 0x000000ff;
resp_data[3] = (controller_value >> 8) & 0x000000ff;
resp_data[4] = (controller_value >> 16) & 0x000000ff;
resp_data[5] = (controller_value >> 24) & 0x000000ff;
memcpy(&resp_data[2], &controller_value, sizeof(controller_value));
// Send the data
send_data(RESPCONTROL_ID, msg_id, resp_data, sizeof(resp_data);
send_data(RESPCONTROL_ID, msg_id, resp_data, sizeof(resp_data));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment