Skip to content

Commit

Permalink
reworked
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-ortega authored Jun 21, 2017
1 parent b7cdafc commit faa3156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/tracker/pitlab.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ uint8_t dataIdx=0;

int32_t Restore_long(int idx)
{
return ((int32_t)lsRxData[idx] << 24) + ((int32_t)lsRxData[idx+1] << 16) + ((int32_t)lsRxData[idx+2] << 8) + ((int32_t)lsRxData[idx+3]);
return (int32_t)lsRxData[idx] + ((int32_t)lsRxData[idx+1] << 8) + ((int32_t)lsRxData[idx+2] << 16) + ((int32_t)lsRxData[idx+3] << 24);
}

int16_t Restore_short(int idx)
{
return ((int16_t)lsRxData[idx] << 8) + (int16_t)lsRxData[idx+1];
return (int16_t)lsRxData[idx] + ((int16_t)lsRxData[idx+1] << 8);
}

uint8_t Restore_byte(int idx)
Expand Down Expand Up @@ -87,7 +87,7 @@ void preProcessHexString(void){
for(uint8_t j = 0; j < 2; ++j){
str_buffer[j] = hexString[sIdx++];
}
lsRxData[i] = hex2int(str_buffer,2);
lsRxData[4-i] = hex2int(str_buffer,2);
}
}

Expand Down

0 comments on commit faa3156

Please sign in to comment.