Mercurial > public > ostc4
comparison Discovery/Src/tInfoCompass.c @ 243:b7b481df4f22 div-fixes-5
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 <jlmulder@xs4all.nl>
| author | Jan Mulder <jlmulder@xs4all.nl> |
|---|---|
| date | Mon, 08 Apr 2019 12:35:59 +0200 |
| parents | 5f11787b4f42 |
| children | 65d35e66efb9 |
comparison
equal
deleted
inserted
replaced
| 242:b23de15e2861 | 243:b7b481df4f22 |
|---|---|
| 25 /// You should have received a copy of the GNU General Public License | 25 /// You should have received a copy of the GNU General Public License |
| 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 27 ////////////////////////////////////////////////////////////////////////////// | 27 ////////////////////////////////////////////////////////////////////////////// |
| 28 | 28 |
| 29 /* Includes ------------------------------------------------------------------*/ | 29 /* Includes ------------------------------------------------------------------*/ |
| 30 | |
| 31 #include "gfx_engine.h" | |
| 32 #include "gfx_fonts.h" | |
| 33 #include "tHome.h" | |
| 34 #include "tInfo.h" | |
| 30 #include "tInfoCompass.h" | 35 #include "tInfoCompass.h" |
| 31 | |
| 32 #include "gfx_fonts.h" | |
| 33 #include "tInfo.h" | |
| 34 | 36 |
| 35 #include <string.h> | 37 #include <string.h> |
| 36 | 38 |
| 37 /* Private variables ---------------------------------------------------------*/ | 39 /* Private variables ---------------------------------------------------------*/ |
| 38 | 40 |
| 57 // =============================================================================== | 59 // =============================================================================== |
| 58 // refreshInfo_Compass | 60 // refreshInfo_Compass |
| 59 /// @brief there is only compass_DX_f, compass_DY_f, compass_DZ_f output during this mode | 61 /// @brief there is only compass_DX_f, compass_DY_f, compass_DZ_f output during this mode |
| 60 /// the accel is not called during this process | 62 /// the accel is not called during this process |
| 61 // =============================================================================== | 63 // =============================================================================== |
| 62 void refreshInfo_Compass(void) | 64 void refreshInfo_Compass(GFX_DrawCfgScreen s) |
| 63 { | 65 { |
| 66 | |
| 67 tHome_show_lost_connection_count(&s); | |
| 64 tInfoCompassTimeout--; | 68 tInfoCompassTimeout--; |
| 65 if(tInfoCompassTimeout == 0) | 69 if(tInfoCompassTimeout == 0) |
| 66 { | 70 { |
| 67 exitInfo(); | 71 exitInfo(); |
| 68 return; | 72 return; |
| 92 if(compassValues[i] > minMaxCompassDX[i][1]) | 96 if(compassValues[i] > minMaxCompassDX[i][1]) |
| 93 minMaxCompassDX[i][1] = compassValues[i]; | 97 minMaxCompassDX[i][1] = compassValues[i]; |
| 94 } | 98 } |
| 95 | 99 |
| 96 snprintf(text,80,"Time left: %u s",(tInfoCompassTimeout+9)/10); | 100 snprintf(text,80,"Time left: %u s",(tInfoCompassTimeout+9)/10); |
| 97 tInfo_write_content_simple( 20,800, 20, &FontT42, text, CLUT_InfoCompass); | 101 tInfo_write_content_simple( 20,800, 25, &FontT42, text, CLUT_InfoCompass); |
| 98 | 102 |
| 99 for(int i = 0; i<3;i ++) | 103 for(int i = 0; i<3;i ++) |
| 100 { | 104 { |
| 101 snprintf(text,80,"%c: %i" "\t(%i, %i)", | 105 snprintf(text,80,"%c: %i" "\t(%i, %i)", |
| 102 'X'+i, | 106 'X'+i, |
