mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-16 11:26:35 +00:00
Clean up AIS lat/lon types and formatting.
This commit is contained in:
@@ -178,13 +178,13 @@ DateTime Packet::datetime(const size_t start_bit) const {
|
||||
Latitude Packet::latitude(const size_t start_bit) const {
|
||||
// Shifting and dividing is to sign-extend the source field.
|
||||
// TODO: There's probably a more elegant way to do it.
|
||||
return static_cast<int32_t>(field_.read(start_bit, 27) << 5) / 32;
|
||||
return field_.read(start_bit, 27);
|
||||
}
|
||||
|
||||
Longitude Packet::longitude(const size_t start_bit) const {
|
||||
// Shifting and dividing is to sign-extend the source field.
|
||||
// TODO: There's probably a more elegant way to do it.
|
||||
return static_cast<int32_t>(field_.read(start_bit, 28) << 4) / 16;
|
||||
return field_.read(start_bit, 28);
|
||||
}
|
||||
|
||||
bool Packet::crc_ok() const {
|
||||
|
Reference in New Issue
Block a user