HOTT - fixed wrong operation order

Multiply first to prevent rounding error.
This commit is contained in:
Petr Ledvina 2014-11-20 14:56:22 +01:00
parent 2f67002add
commit 648e81d996
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ void hottPrepareGPSResponse(HOTT_GPS_MSG_t *hottGPSMessage)
addGPSCoordinates(hottGPSMessage, GPS_coord[LAT], GPS_coord[LON]);
// GPS Speed in km/h
uint16_t speed = (GPS_speed / 100) * 36; // 0->1m/s * 0->36 = km/h
uint16_t speed = (GPS_speed * 36) / 100; // 0->1m/s * 0->36 = km/h
hottGPSMessage->gps_speed_L = speed & 0x00FF;
hottGPSMessage->gps_speed_H = speed >> 8;