littleshrimp 发表于 2017-3-15 23:52

osxMotionFX的移植和调试过程

<div class='showpostmsg'><div class="WordSection1"><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">下载</span><span lang="EN-US" style="background: whitesmoke; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 10pt;">osxMotionFX</span></p><p class="MsoNormal"><span lang="EN-US">http://www.st.com/content/st_com/en/products/embedded-software/mems-and-sensors-software/open-mems/osxmotionfx.html</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p><p class="MsoNormal"><span lang="EN-US"></span></p><p class="MsoNormal"><span style="font-family: 宋体;">找到</span><span lang="EN-US">en.osxMotionFX_Software.zip</span><span style="font-family: 宋体;">解压并安装</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">安装完成后在</span><span lang="EN-US">C:\Program Files (x86)\STMicroelectronics\OpenSoftwareX\Workspace\Middlewares\ST\</span><span style="font-family: 宋体;">下会有一个</span><span lang="EN-US">STM32_OSX_MotionFX_Library</span><span style="font-family: 宋体;">的文件夹</span></p><p class="MsoNormal"><span style="font-family: 宋体;">将</span><span lang="EN-US">STM32_OSX_MotionFX_Library</span><span style="font-family: 宋体;">文件夹全部复制到</span><span lang="EN-US">STSW-STLKT01 v1.2.0\Middlewares\ST</span><span style="font-family: 宋体;">下</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">复制</span><span lang="EN-US">\STSW-STLKT01 v1.2.0\Projects\SensorTile\Applications</span><span style="font-family: 宋体;">下的</span><span lang="EN-US">BLE_SampleApp</span><span style="font-family: 宋体;">项目起名</span><span lang="EN-US">BLE_ osxMotionCP</span></p><p class="MsoNormal"><span style="font-family: 宋体;">复制</span><span lang="EN-US">C:\Program Files (x86)\STMicroelectronics\OpenSoftwareX\Workspace\Projects\Multi\Applications\DataLogFusion\Src\MotionFX_Manager.c</span></p><p class="MsoNormal"><span style="font-family: 宋体;">和</span><span lang="EN-US">C:\Program Files (x86)\STMicroelectronics\OpenSoftwareX\Workspace\Projects\Multi\Applications\DataLogFusion\Inc\MotionFX_Manager.h</span></p><p class="MsoNormal"><span style="font-family: 宋体;">到</span><span lang="EN-US">STSW-STLKT01 v1.2.0\Projects\SensorTile\Applications\BLE_ osxMotionCP\Src</span><span style="font-family: 宋体;">和</span><span lang="EN-US">STSW-STLKT01 v1.2.0\Projects\SensorTile\Applications\BLE_ osxMotionCP\Inc</span></p><p class="MsoNormal"><span style="font-family: 宋体;">打开</span><span lang="EN-US">BLE_ osxMotionCP</span><span style="font-family: 宋体;">项目</span></p><p class="MsoNormal"><span style="font-family: 宋体;">将</span><span lang="EN-US">LSM303AGR</span><span style="font-family: 宋体;">和</span><span lang="EN-US">LSM6DSM</span><span style="font-family: 宋体;">的驱动加入项目</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span style="font-family: 宋体;">将</span><span lang="EN-US">STSW-STLKT01 v1.2.0\Middlewares\ST\STM32_OSX_MotionFX_Library\Lib\osxMotionFX107_CM4_Keil_ot.lib</span><span style="font-family: 宋体;">引入项目</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">添加</span><span lang="EN-US">STM32_OSX_MotionFX_Library</span><span style="font-family: 宋体;">的引用到</span><span lang="EN-US">IAR</span><span style="font-family: 宋体;">工程</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">$PROJ_DIR$\..\..\..\..\..\Middlewares\ST\STM32_OSX_MotionFX_Library</span></p><p class="MsoNormal"><span lang="EN-US">$PROJ_DIR$\..\..\..\..\..\Middlewares\ST\STM32_OSX_MotionFX_Library\Inc</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">添加头文件到</span><span lang="EN-US">TargetFeatures.h</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="568" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 426.1pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#include "SensorTile_accelero.h"</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#include "SensorTile_gyro.h"</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#include "SensorTile_magneto.h"</span></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">添加</span><span lang="EN-US">LSM303AGR</span><span style="font-family: 宋体;">和</span><span lang="EN-US">LSM6DSM</span><span style="font-family: 宋体;">的初始化程序到</span><span lang="EN-US">TargetPlatform.c</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="568" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 426.1pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">NULL</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_G_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">NULL</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_X_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">NULL</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_M_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">NULL</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="699" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 524.1pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">BSP_ACCELERO_Init</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">!=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> COMPONENT_OK</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">while</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">BSP_GYRO_Init</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_G_0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_G_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">!=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> COMPONENT_OK</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">while</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">BSP_ACCELERO_Init</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_X_0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_X_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">!=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> COMPONENT_OK</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">while</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">BSP_MAGNETO_Init</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_M_0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_M_0_handle   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">!=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> COMPONENT_OK</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">while</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_ACCELERO_Sensor_Enable</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_GYRO_Sensor_Enable</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_G_0_handle </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_ACCELERO_Sensor_Enable</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_X_0_handle </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_MAGNETO_Sensor_Enable</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_M_0_handle </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">修改</span><span lang="EN-US">STSW-STLKT01 v1.2.0\Middlewares\ST\STM32_OSX_MotionFX_Library\osx_license.h</span></p><p class="MsoNormal"><span style="font-family: 宋体;">去掉</span><span lang="EN-US">#error "NOTE: this is a dummy license file. Use the osx.LicenseWizard to request a valid license"</span></p><p class="MsoNormal"><span style="font-family: 宋体;">用新申请的</span><span lang="EN-US">license</span><span style="font-family: 宋体;">替换原有代码</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="568" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 426.1pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">/*   Below line has to be removed once the license has been edited with validcodes */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#ifndef_OSX_MOTION_FX_LICENSE_</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#define_OSX_MOTION_FX_LICENSE_</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">osx_mfx_license</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">3</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">][</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">4</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x4179FF8B</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x9F7582CF</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x09EAE338</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x857D6684</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">},</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x630E2677</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x166FDE0F</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x4ED8FD4F</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x3A5AB519</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">},</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x236DB5C3</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x760B4854</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x7F60744B</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x23CA44D5</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">};</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* _OSX_MOTION_FX_LICENSE_ */</span></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">在</span><span lang="EN-US">TargetPlatform.c</span><span style="font-family: 宋体;">中添加传感器测试代码测试传感器是否可以使用</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="568" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 426.1pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">sensorTest</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint8_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> id</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;SensorAxes_t acceleration</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint8_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> status</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_ACCELERO_Get_Instance</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">id </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_ACCELERO_IsInitialized</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">status   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> status </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">==</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">BSP_ACCELERO_Get_Axes</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">acceleration   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">==</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">COMPONENT_ERROR </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;acceleration</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_X </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;acceleration</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Y </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;acceleration</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Z </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;__NOP</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">在</span><span lang="EN-US">main</span><span style="font-family: 宋体;">函数的</span><span lang="EN-US">InitTargetPlatform(TARGET_SENSORTILE);</span><span style="font-family: 宋体;">代码下添加</span><span lang="EN-US">sensorTest</span><span style="font-family: 宋体;">函数</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="568" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 426.1pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   InitTargetPlatform</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">TARGET_SENSORTILE</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">while</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;sensorTest</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">将断点打到</span><span lang="EN-US">sensorTest</span><span style="font-family: 宋体;">函数的</span><span lang="EN-US">__NOP();</span><span style="font-family: 宋体;">处运行程序</span> <span style="font-family: 宋体;">,查看</span><span lang="EN-US">acceleration</span><span style="font-family: 宋体;">变量的三个轴数据是否正确</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">成功后注释掉</span><span lang="EN-US">sensorTest</span><span style="font-family: 宋体;">函数</span></p><p class="MsoNormal"><span style="font-family: 宋体;">在在</span><span lang="EN-US">TargetPlatform.c</span><span style="font-family: 宋体;">中添加传感器测试代码测试传感器是否可以使用</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">在</span><span lang="EN-US">MotionFX_Manager.c</span><span style="font-family: 宋体;">文件中引用</span><span lang="EN-US">#include "sensor.h"</span></p><p class="MsoNormal"><span style="font-family: 宋体;">添加下边代码到</span><span lang="EN-US">TargetPlatform.c</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="568" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 426.1pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">SensorAxes_tACC_Value;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">SensorAxes_tGYR_Value;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">SensorAxes_tMAG_Value;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">void*GYRO_handle;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">osxMFX_calibFactormagOffset;</span></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">去年</span><span lang="EN-US">stm32l4xx_hal_conf.h</span><span style="font-family: 宋体;">中</span><span lang="EN-US">/* #define HAL_RTC_MODULE_ENABLED */</span><span style="font-family: 宋体;">的注释</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">在</span><span lang="EN-US">TargetPlatform.c</span><span style="font-family: 宋体;">中添加</span><span lang="EN-US">#include "MotionFX_Manager.h"</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">添加</span><span lang="EN-US">ENABLE_USB_DEBUG</span><span style="font-family: 宋体;">宏定义使能</span><span lang="EN-US">USB</span><span style="font-family: 宋体;">功能</span></p><p class="MsoNormal"><span style="font-family: 宋体;">添加</span><span lang="EN-US">MotionFX</span><span style="font-family: 宋体;">测试代码到</span><span lang="EN-US">TargetPlatform.c</span></p><table class="MsoTableGrid" style="border: currentcolor;" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td width="850" valign="top" style="padding: 0cm 5.4pt; border-width: 1pt; border-color: windowtext; border-image-source: none; width: 637.5pt;"><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">counter </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">/**</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@brief&nbsp; Reset the Magnetometer calibration values in memory</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@param&nbsp; None</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@retval 1 in case of success, 0 otherwise</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">unsigned</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">char</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">ResetCalibrationInMemory</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#ifdefOSXMOTIONFX_STORE_CALIB_FLASH</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Reset Calibration Values in FLASH */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">unsigned</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">char</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Success </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Erase First Flash sector */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;FLASH_EraseInitTypeDef EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> SectorError </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32F4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">TypeErase </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">TYPEERASE_SECTORS</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">VoltageRange </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">VOLTAGE_RANGE_3</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Sector </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">OSXMOTIONFX_FLASH_SECTOR</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">NbSectors </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32L4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">TypeErase&nbsp;&nbsp; </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">FLASH_TYPEERASE_PAGES</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Banks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> GetBank</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">OSXMOTIONFX_FLASH_ADD</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Page&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> GetPage</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">OSXMOTIONFX_FLASH_ADD</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">NbPages&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Unlock the Flash to enable the flash control register access*************/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;HAL_FLASH_Unlock</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">HAL_FLASHEx_Erase</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">EraseInitStruct</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">SectorError</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">!=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">HAL_OK</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/*</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Error occurred while sector erase.</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User can add here some code to deal with this error.</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SectorError will contain the faulty sector and then to know the code error onthis sector,</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user can call function 'HAL_FLASH_GetError()'</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;*/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/*</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FLASH_ErrorTypeDef errorcode = HAL_FLASH_GetError();</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;*/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;Error_Handler</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;Success </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Lock the Flash to disable the flash control register access(recommended</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;to protect the FLASH memory against possible unwanted operation) *********/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;HAL_FLASH_Lock</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">return</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> Success</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#else   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* OSXMOTIONFX_STORE_CALIB_FLASH */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Reset Calibration Values in RAM */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">unsigned</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">char</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Success </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">int32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> Counter</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">for</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Counter </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Counter </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&lt;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">8</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Counter</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">++)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Counter</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0xFFFFFFFF</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">return</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> Success</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* OSXMOTIONFX_STORE_CALIB_FLASH */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">/**</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@brief&nbsp; Save the Magnetometer calibration values to memory</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@param&nbsp; None</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@retval 1 in case of success, 0 otherwise</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">unsigned</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">char</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">SaveCalibrationToMemory</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">unsigned</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">char</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Success </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Reset Before The data in Memory */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;Success </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> ResetCalibrationInMemory</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Success</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#ifdefOSXMOTIONFX_STORE_CALIB_FLASH</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Store in Flash Memory */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> Address </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">OSXMOTIONFX_FLASH_ADD</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32F4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">8</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">];</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32L4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint64_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">8</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">];</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">int32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> WriteIndex</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32F4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">OSXMOTIONFX_CHECK_CALIBRATION</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffX</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">2</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffY</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">3</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffZ</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">4</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainX</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">5</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainY</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">6</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainZ</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">7</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">expMagVect</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32L4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint64_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">OSXMOTIONFX_CHECK_CALIBRATION</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint64_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffX</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">2</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint64_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffY</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">3</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint64_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffZ</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">4</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainX</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">5</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainY</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">6</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainZ</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">7</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">expMagVect</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Unlock the Flash to enable the flash control register access*************/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;HAL_FLASH_Unlock</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32F4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">for</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&lt;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">8</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">++)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32L4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">for</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&lt;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">8</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">++)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32F4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">HAL_FLASH_Program</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">TYPEPROGRAM_WORD</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Address</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> WritemagOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">])</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">==</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">HAL_OK</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> Address </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">+</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">4</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#if(defined (USE_STM32L4XX_NUCLEO))</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">HAL_FLASH_Program</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">FLASH_TYPEPROGRAM_DOUBLEWORD</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">Address</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> WritemagOffset64</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">WriteIndex</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">])</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">==</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">HAL_OK</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Address </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> Address </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">+</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">8</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">else</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Error occurred while writing data in Flash memory.</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User can add here some code to deal with this error */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/*</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FLASH_ErrorTypeDef errorcode = HAL_FLASH_GetError();</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Error_Handler</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Lock the Flash to disable the flash control register access(recommended</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;to protect the FLASH memory against possible unwanted operation) *********/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;HAL_FLASH_Lock</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#else   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* OSXMOTIONFX_STORE_CALIB_FLASH */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Store in RAM */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">OSXMOTIONFX_CHECK_CALIBRATION</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffX</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">2</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffY</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">3</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint32_t</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffZ</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">4</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainX</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">5</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainY</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">6</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magGainZ</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;memcpy</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">CalibrationStructureRAM</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">7</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">],</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">expMagVect</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">sizeof</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">float</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 64, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">#endif   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* OSXMOTIONFX_STORE_CALIB_FLASH */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">return</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> Success</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">/**</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@brief&nbsp; Handles the Sensor Fusion</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@param&nbsp; Msg Sensor Fusion part of the stream</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*@retval None</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: teal; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;*/</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">SF_Handler</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">static</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">int32_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">calibIndex </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint8_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> i</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint8_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> status_acc </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint8_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> status_gyr </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">uint8_t</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> status_mag </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_ACCELERO_IsInitialized</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">status_acc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_GYRO_IsInitialized</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_G_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">status_gyr</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;BSP_MAGNETO_IsInitialized</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_M_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">status_mag</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">status_acc </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">status_gyr </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> status_mag</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BSP_ACCELERO_Get_Axes</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_X_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">ACC_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BSP_GYRO_Get_Axes</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM6DSM_G_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">GYR_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BSP_MAGNETO_Get_Axes</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">LSM303AGR_M_0_handle</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MAG_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MotionFX_manager_run</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Check if is calibrated */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">isCal </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">!=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x01</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Run Compass Calibration @ 25Hz */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;calibIndex</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">++;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">calibIndex </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">==</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">4</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SensorAxes_t ACC_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> MAG_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;calibIndex </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ACC_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_X </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">ACC_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ACC_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Y </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">ACC_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Y</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ACC_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Z </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">ACC_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Z</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAG_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_X </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MAG_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAG_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Y </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MAG_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Y</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAG_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Z </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MAG_Value</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Z</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">;</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;osx_MotionFX_compass_saveAcc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">ACC_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">ACC_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Y</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> ACC_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Z</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/*Accelerometer data ENU systems coordinate&nbsp; */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;osx_MotionFX_compass_saveMag</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MAG_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MAG_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Y</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> MAG_Loc</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">.</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">AXIS_Z</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/*Magnetometer data ENU systems coordinate */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;osx_MotionFX_compass_run</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Check if is calibrated */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isCal </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> osx_MotionFX_compass_isCalibrated</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">isCal </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">==</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0x01</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Get new magnetometer offset */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;osx_MotionFX_getCalibrationData</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(&amp;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">magOffset</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">);</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span lang="EN-US" style="color: green; font-family: &quot;Courier New&quot;; font-size: 10pt;">/* Save the calibration in Memory */</span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SaveCalibrationToMemory</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;osxMFX_output </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MotionFX_Engine_Out </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">=</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MotionFX_manager_getDataOUT</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">if</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">counter</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">++</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">%</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">100</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">==</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STLBLE_PRINTF</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: gray; font-family: &quot;Courier New&quot;; font-size: 10pt;">"%d\t%d\t%d\r\n"</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">,(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">int</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MotionFX_Engine_Out</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">-&gt;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">rotation_9X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">0</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1000</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">int</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MotionFX_Engine_Out</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">-&gt;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">rotation_9X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1000</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">),(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">int</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)(</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">MotionFX_Engine_Out</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">-&gt;</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">rotation_9X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">[</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">2</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">]</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">*</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;"> </span><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1000</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">));</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">fxText</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(128, 0, 255); font-family: &quot;Courier New&quot;; font-size: 10pt;">void</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;MotionFX_manager_init</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;MotionFX_manager_start_9X</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;osx_MotionFX_compass_forceReCalibration</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: blue; font-family: &quot;Courier New&quot;; font-size: 10pt;">while</span></b><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">(</span></b><span lang="EN-US" style="color: rgb(255, 128, 0); font-family: &quot;Courier New&quot;; font-size: 10pt;">1</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">)</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">{</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;&nbsp;&nbsp;SF_Handler</span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">();</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span lang="EN-US" style="color: black; font-family: &quot;Courier New&quot;; font-size: 10pt;">&nbsp;   </span><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p><p align="left" class="MsoNormal" style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><b><span lang="EN-US" style="color: navy; font-family: &quot;Courier New&quot;; font-size: 10pt;">}</span></b></p></td></tr></tbody></table><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span style="font-family: 宋体;">运行代码可以看到串口输出数据,活动板子可以看到数据变化,但是数据是不准的</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p></div><p></p></div><script>                                        var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;"   style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
                                       
                                        if(parseInt(discuz_uid)==0){
                                                                                                (function($){
                                                        var postHeight = getTextHeight(400);
                                                        $(".showpostmsg").html($(".showpostmsg").html());
                                                        $(".showpostmsg").after(loginstr);
                                                        $(".showpostmsg").css({height:postHeight,overflow:"hidden"});
                                                })(jQuery);
                                        }                </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>

fyaocn 发表于 2017-3-16 09:53

。。

w562601331 发表于 2017-3-17 18:57

数据不准是因为没有校准还是什么问题呢?

littleshrimp 发表于 2017-3-17 19:48

这个是我当时对rotation_9X变量的理解不够

hezhengjia 发表于 2017-4-25 08:17

你好。请问你移植之后。是怎么进行传感器的校准的?

strong161 发表于 2017-4-26 12:49

iar为啥要用keil的lib?

sogaside 发表于 2017-4-26 15:41

楼主 要是只要算法来处理数据的话要怎么来弄啊?

littleshrimp 发表于 2017-4-28 19:09

strong161 发表于 2017-4-26 12:49
iar为啥要用keil的lib?

好眼力,贴子写错了,应该是“osxMotionFX107_CM4_IAR_ot.a”
:pleased:

littleshrimp 发表于 2017-4-28 19:09

sogaside 发表于 2017-4-26 15:41
楼主 要是只要算法来处理数据的话要怎么来弄啊?

只要算法来处理?没明白你的意思:puzzle:

strong161 发表于 2017-4-28 19:20

littleshrimp 发表于 2017-4-28 19:09
好眼力,贴子写错了,应该是“osxMotionFX107_CM4_IAR_ot.a”

:lol 主查细看了一下因为跟你的贴学习使用库,才发现不对的!

littleshrimp 发表于 2017-4-28 20:35

strong161 发表于 2017-4-28 19:20
主查细看了一下因为跟你的贴学习使用库,才发现不对的!

:congratulate:

sogaside 发表于 2017-4-29 10:39

littleshrimp 发表于 2017-4-28 19:09
只要算法来处理?没明白你的意思

就是我把传感器数据传出去 ,在别的板子上处理数据,需要用到这个算法

littleshrimp 发表于 2017-4-29 10:42

sogaside 发表于 2017-4-29 10:39
就是我把传感器数据传出去 ,在别的板子上处理数据,需要用到这个算法

你的意思是想在别的板子上用这个算法吗?

sogaside 发表于 2017-4-29 21:34

littleshrimp 发表于 2017-4-29 10:42
你的意思是想在别的板子上用这个算法吗?

恩 在nucleo-f401re这个板子上用

littleshrimp 发表于 2017-4-30 08:49



没试过 应该能移植
http://www.st.com/en/embedded-software/open-mems.html?icmp=sc1998_pron_pr_nov2014&sc=openmems-pr&querycriteria=productId=SC1998

alberthink 发表于 2017-4-30 09:15

那你就采用nucleo套件(f401+iks01)连接电脑或者(f401+iks01+idb05)连到bluems申请许可证就好了。

a217zxg 发表于 2019-1-17 10:54

1、如果没有九轴,只有6轴的放,这个rotation变量有什么意义呢?
2、能够用LSM6DS3来测量角度吗?

littleshrimp 发表于 2019-1-17 14:49

a217zxg 发表于 2019-1-17 10:54
1、如果没有九轴,只有6轴的放,这个rotation变量有什么意义呢?
2、能够用LSM6DS3来测量角度吗?


6轴时用rotation_6X


你要测量什么角度?

a217zxg 发表于 2019-1-18 08:20

littleshrimp 发表于 2019-1-17 14:49
6轴时用rotation_6X


你要测量什么角度?

我想测一个机构的合位位置,在两个位置分别的角度。

下面的数据是我通过motionGC库出来的静止时角速度的值? 再通过motionFx库后,rotation的值一直在跳变。这个合理吗?

the af_gro val: x=-1433, y= -968, z= 2491
the af_gro val: x=-1434, y= -968, z= 2490
the af_gro val: x=-1435, y= -969, z= 2490
the af_gro val: x=-1434, y= -969, z= 2490
the af_gro val: x=-1438, y= -974, z= 2484
the af_gro val: x=-1436, y= -970, z= 2489
the af_gro val: x=-1433, y= -969, z= 2487
the af_gro val: x=-1435, y= -976, z= 2486
the af_gro val: x=-1437, y= -979, z= 2487
the af_gro val: x=-1436, y= -978, z= 2487
the af_gro val: x=-1433, y= -974, z= 2489
the af_gro val: x=-1434, y= -974, z= 2489
the af_gro val: x=-1437, y= -977, z= 2489
the af_gro val: x=-1437, y= -981, z= 2489
the af_gro val: x=-1430, y= -974, z= 2487
the af_gro val: x=-1431, y= -966, z= 2487
the af_gro val: x=-1428, y= -968, z= 2488
the af_gro val: x=-1426, y= -964, z= 2487
the af_gro val: x=-1428, y= -965, z= 2487

zhuyebb 发表于 2019-1-18 08:32

页: [1] 2 3
查看完整版本: osxMotionFX的移植和调试过程