comparison Discovery/Src/data_exchange_main.c @ 539:d784f281833a

Added inertia simulation for compass heading: In previous version calculated compass values were directly used for visualization of the compass. This causes a fast changing (jumping) of values. With the inertia introduction the compass behalfs more like an analog compass. The final value is reached slowly and the displayed values are more stable. For configuration a new menu item has been added to the compass menu allowing to switch inertia off (default), small and large inertia simulation
author Ideenmodellierer
date Sat, 10 Oct 2020 16:59:18 +0200
parents 5757edda56b7
children eb2060caca7d
comparison
equal deleted inserted replaced
538:b1eee27cd02b 539:d784f281833a
968 pStateReal->lifeData.compass_DZ_f = dataIn.data[dataIn.boolCompassData].compass_DZ_f; 968 pStateReal->lifeData.compass_DZ_f = dataIn.data[dataIn.boolCompassData].compass_DZ_f;
969 969
970 pStateReal->compass_uTick_old = pStateReal->compass_uTick_new; 970 pStateReal->compass_uTick_old = pStateReal->compass_uTick_new;
971 pStateReal->compass_uTick_new = dataIn.data[dataIn.boolCompassData].compass_uTick; 971 pStateReal->compass_uTick_new = dataIn.data[dataIn.boolCompassData].compass_uTick;
972 pStateReal->compass_uTick_local_new = HAL_GetTick(); 972 pStateReal->compass_uTick_local_new = HAL_GetTick();
973 compass_Inertia(pStateReal->lifeData.compass_heading);
973 974
974 memcpy(pStateReal->lifeData.tissue_nitrogen_bar, dataIn.data[dataIn.boolTisssueData].tissue_nitrogen_bar,sizeof(pStateReal->lifeData.tissue_nitrogen_bar)); 975 memcpy(pStateReal->lifeData.tissue_nitrogen_bar, dataIn.data[dataIn.boolTisssueData].tissue_nitrogen_bar,sizeof(pStateReal->lifeData.tissue_nitrogen_bar));
975 memcpy(pStateReal->lifeData.tissue_helium_bar, dataIn.data[dataIn.boolTisssueData].tissue_helium_bar,sizeof(pStateReal->lifeData.tissue_helium_bar)); 976 memcpy(pStateReal->lifeData.tissue_helium_bar, dataIn.data[dataIn.boolTisssueData].tissue_helium_bar,sizeof(pStateReal->lifeData.tissue_helium_bar));
976 977
977 if(pStateReal->mode == MODE_DIVE) 978 if(pStateReal->mode == MODE_DIVE)