comparison Small_CPU/Src/compass.c @ 115:3834b6272ee5 FlipDisplay

Merge with 68181cd61f2069d061621c2cd2a6afddb7486f5e
author Ideenmodellierer
date Thu, 03 Jan 2019 19:59:36 +0100
parents 22a1094545f3
children 14e4c83a7559
comparison
equal deleted inserted replaced
114:79b19d56ab08 115:3834b6272ee5
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 }
1885 1885
1886 compass_solve_calibration(&g); 1886 compass_solve_calibration(&g);
1887 1887
1888 tfull32 dataBlock[4]; 1888 tfull32 dataBlock[4];
1889 dataBlock[0].Word16.low16 = compass_CX_f; 1889 dataBlock[0].Word16.low16 = compass_CX_f;