# HG changeset patch # User Jan Mulder # Date 1554719759 -7200 # Node ID b7b481df4f22d9ebf0356b0984a6fe6f90da08ef # Parent b23de15e286191c8828272e827fd9e0a132fa946 debug: add SPI error counter to compass calibration This is a debug only extension. It is possible to force SPI errors and a failing compass calibration by rotating fast during the calibration cycle. This extra debug output (only activated with the proper #define statements) is a first aid in helping to find the underlying issue. Signed-off-by: Jan Mulder diff -r b23de15e2861 -r b7b481df4f22 Discovery/Inc/tInfoCompass.h --- a/Discovery/Inc/tInfoCompass.h Mon Apr 08 12:02:07 2019 +0200 +++ b/Discovery/Inc/tInfoCompass.h Mon Apr 08 12:35:59 2019 +0200 @@ -30,7 +30,7 @@ /* Exported functions --------------------------------------------------------*/ void openInfo_Compass(void); -void refreshInfo_Compass(void); +void refreshInfo_Compass(GFX_DrawCfgScreen s); #endif /* TINFO_COMPASS_H */ diff -r b23de15e2861 -r b7b481df4f22 Discovery/Src/tInfo.c --- a/Discovery/Src/tInfo.c Mon Apr 08 12:02:07 2019 +0200 +++ b/Discovery/Src/tInfo.c Mon Apr 08 12:35:59 2019 +0200 @@ -210,7 +210,7 @@ if(inDebugMode()) tDebug_refresh(); else - refreshInfo_Compass(); + refreshInfo_Compass(tIscreen); if(inDebugMode() || (get_globalState() == StICOMPASS)) /* could be timeout and exitInfo */ GFX_SetFramesTopBottom(tIscreen.FBStartAdress, 0,480); diff -r b23de15e2861 -r b7b481df4f22 Discovery/Src/tInfoCompass.c --- a/Discovery/Src/tInfoCompass.c Mon Apr 08 12:02:07 2019 +0200 +++ b/Discovery/Src/tInfoCompass.c Mon Apr 08 12:35:59 2019 +0200 @@ -27,11 +27,13 @@ ////////////////////////////////////////////////////////////////////////////// /* Includes ------------------------------------------------------------------*/ + +#include "gfx_engine.h" +#include "gfx_fonts.h" +#include "tHome.h" +#include "tInfo.h" #include "tInfoCompass.h" -#include "gfx_fonts.h" -#include "tInfo.h" - #include /* Private variables ---------------------------------------------------------*/ @@ -59,8 +61,10 @@ /// @brief there is only compass_DX_f, compass_DY_f, compass_DZ_f output during this mode /// the accel is not called during this process // =============================================================================== -void refreshInfo_Compass(void) +void refreshInfo_Compass(GFX_DrawCfgScreen s) { + + tHome_show_lost_connection_count(&s); tInfoCompassTimeout--; if(tInfoCompassTimeout == 0) { @@ -94,7 +98,7 @@ } snprintf(text,80,"Time left: %u s",(tInfoCompassTimeout+9)/10); - tInfo_write_content_simple( 20,800, 20, &FontT42, text, CLUT_InfoCompass); + tInfo_write_content_simple( 20,800, 25, &FontT42, text, CLUT_InfoCompass); for(int i = 0; i<3;i ++) {