# HG changeset patch # User Ideenmodellierer # Date 1667938394 -3600 # Node ID c799151670d59bfc5439a4476ab9e6059123a352 # Parent 7e3bf2c0cd40a9ce3093ce71fb9a0f7f27534bba Bugfix compass bearing: In previous version an invalid value was set in case the bearing was set without compass calibration. Rootcause was that the bearing -1 is received in case the compase is not calibrated. This has been fixed by setting bearing to 0 (360) in that case. diff -r 7e3bf2c0cd40 -r c799151670d5 Discovery/Src/tMenuEditHardware.c --- a/Discovery/Src/tMenuEditHardware.c Thu Nov 03 20:44:51 2022 +0100 +++ b/Discovery/Src/tMenuEditHardware.c Tue Nov 08 21:13:14 2022 +0100 @@ -241,7 +241,15 @@ uint8_t OnAction_Bearing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { - settingsGetPointer()->compassBearing = (int16_t)stateUsed->lifeData.compass_heading; + if((int16_t)stateUsed->lifeData.compass_heading != -1) + { + settingsGetPointer()->compassBearing = (int16_t)stateUsed->lifeData.compass_heading; + } + else + { + settingsGetPointer()->compassBearing = 0; + } + if(settingsGetPointer()->compassBearing == 0) settingsGetPointer()->compassBearing = 360; return UPDATE_AND_EXIT_TO_MENU;