Skip to content

Commit

Permalink
Fix the other half of a1a347d
Browse files Browse the repository at this point in the history
The previous patch to this file missed out a couple of memcpy changes
also, there was a missing break;


Signed-off-by: andy pugh <andy@bodgesoc.org>
  • Loading branch information
andypugh committed May 14, 2017
1 parent 565cf0e commit d63aca6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hal/drivers/mesa-hostmot2/sserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ int hm2_sserial_create_pins(hostmot2_t *hm2, hm2_sserial_remote_t *chan){
HM2_ERR("error adding pin '%s', aborting\n", name);
return r;
}
break;
default:
HM2_ERR("Unhandled sserial data type (%i) Name %s Units %s\n",
chan->confs[i].DataType,
Expand Down Expand Up @@ -1531,11 +1532,11 @@ int hm2_sserial_read_pins(hm2_sserial_remote_t *chan){
case LBP_FLOAT:
if (conf->DataLength == sizeof(float) * 8){
float temp;
memcpy(&temp, &buff, conf->DataLength);
memcpy(&temp, &buff, sizeof(float));
*pin->float_pin = temp;
} else if (conf->DataLength == sizeof(double) * 8){
double temp;
memcpy(&temp, &buff, conf->DataLength);
memcpy(&temp, &buff, sizeof(double));
*pin->float_pin = temp;
} else {
HM2_ERR_NO_LL("sserial read: LBP_FLOAT of bit-length %i not handled\n", conf->DataLength);
Expand Down

0 comments on commit d63aca6

Please sign in to comment.