From 082d5cf23df6c40b3771bc4e8c94c219f98b354e Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Sat, 6 Feb 2021 09:56:28 +0100 Subject: [PATCH] imet1rs: bugfix raspi bus error --- imet/imet1rs_dft.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/imet/imet1rs_dft.c b/imet/imet1rs_dft.c index 0625021..b93003a 100644 --- a/imet/imet1rs_dft.c +++ b/imet/imet1rs_dft.c @@ -285,8 +285,12 @@ int print_GPS(int pos) { crc_val = ((byteframe+pos)[pos_GPScrc] << 8) | (byteframe+pos)[pos_GPScrc+1]; crc = crc16(byteframe+pos, pos_GPScrc); // len=pos - lat = *(float*)(byteframe+pos+pos_GPSlat); - lon = *(float*)(byteframe+pos+pos_GPSlon); + //lat = *(float*)(byteframe+pos+pos_GPSlat); + //lon = *(float*)(byteframe+pos+pos_GPSlon); + // //raspi: copy into (aligned) float + memcpy(&lat, byteframe+pos+pos_GPSlat, 4); + memcpy(&lon, byteframe+pos+pos_GPSlon, 4); + alt = ((byteframe+pos)[pos_GPSalt+1]<<8)+(byteframe+pos)[pos_GPSalt] - 5000; sats = (byteframe+pos)[pos_GPSsats]; std = (byteframe+pos)[pos_GPStim+0];