comparison Small_CPU/Src/compass.c @ 160:e3ca52b8e7fa

Merge with FlipDisplay
author heinrichsweikamp
date Thu, 07 Mar 2019 15:06:43 +0100
parents 14e4c83a7559
children 9ecc2e60418d
comparison
equal deleted inserted replaced
80:cc2bb7bb8456 160:e3ca52b8e7fa
1851 tickstart = HAL_GetTick(); 1851 tickstart = HAL_GetTick();
1852 // Eine Minute kalibrieren 1852 // Eine Minute kalibrieren
1853 while((ticks) < 60 * 1000) 1853 while((ticks) < 60 * 1000)
1854 { 1854 {
1855 compass_read(); 1855 compass_read();
1856
1857 acceleration_read(); 1856 acceleration_read();
1858 compass_calc_roll_pitch_only(); 1857 compass_calc_roll_pitch_only();
1859 1858
1860 if((hardwareCompass == HMC5883L) 1859 if((hardwareCompass == HMC5883L)
1861 &&((compass_DX_f == -4096) || 1860 &&((compass_DX_f == -4096) ||
1871 //tickstart = HAL_GetTick(); 1870 //tickstart = HAL_GetTick();
1872 continue; 1871 continue;
1873 } 1872 }
1874 1873
1875 copyCompassDataDuringCalibration(compass_DX_f,compass_DY_f,compass_DZ_f); 1874 copyCompassDataDuringCalibration(compass_DX_f,compass_DY_f,compass_DZ_f);
1876 compass_add_calibration(&g); 1875 compass_add_calibration(&g);
1877 HAL_Delay(1); 1876 HAL_Delay(1);
1878 lasttick = HAL_GetTick(); 1877 lasttick = HAL_GetTick();
1879 if(lasttick == 0) 1878 if(lasttick == 0)
1880 { 1879 {
1881 tickstart = -ticks; 1880 tickstart = -ticks;
1882 } 1881 }
1882 HAL_Delay(1);
1883 ticks = lasttick - tickstart; 1883 ticks = lasttick - tickstart;
1884 } 1884 SPI_Evaluate_RX_Data();
1885 }
1885 1886
1886 compass_solve_calibration(&g); 1887 compass_solve_calibration(&g);
1887 1888
1888 tfull32 dataBlock[4]; 1889 tfull32 dataBlock[4];
1889 dataBlock[0].Word16.low16 = compass_CX_f; 1890 dataBlock[0].Word16.low16 = compass_CX_f;