Rev 530 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 530 | Rev 767 | ||
---|---|---|---|
Line 257... | Line 257... | ||
257 | { |
257 | { |
258 | sprintf(msg, " MK3MAG V%d.%d%c", MK3MAG_Version.Major, MK3MAG_Version.Minor, 'a' + MK3MAG_Version.Patch); |
258 | sprintf(msg, " MK3MAG V%d.%d%c", MK3MAG_Version.Major, MK3MAG_Version.Minor, 'a' + MK3MAG_Version.Patch); |
259 | UART1_PutString(msg); |
259 | UART1_PutString(msg); |
260 | if(MK3MAG_Version.Compatible != MK3MAG_I2C_COMPATIBLE) |
260 | if(MK3MAG_Version.Compatible != MK3MAG_I2C_COMPATIBLE) |
261 | { |
261 | { |
262 | UART1_PutString("\n\r MK3MAG not compatible!"); |
262 | UART1_PutString("\r\n MK3MAG not compatible!"); |
263 | UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_INCOMPATIBLE; |
263 | UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_INCOMPATIBLE; |
264 | LED_RED_ON; |
264 | LED_RED_ON; |
265 | } |
265 | } |
266 | else |
266 | else |
267 | { // version ok |
267 | { // version ok |
Line 300... | Line 300... | ||
300 | switch(Compass_CalState) |
300 | switch(Compass_CalState) |
301 | { |
301 | { |
302 | case 1: |
302 | case 1: |
303 | if(last_state != Compass_CalState) |
303 | if(last_state != Compass_CalState) |
304 | { |
304 | { |
305 | UART1_PutString("\r\nMK3Mag calibration\n\r"); |
305 | UART1_PutString("\r\nMK3Mag calibration\r\n"); |
306 | if(EarthMagneticStrengthTheoretic) |
306 | if(EarthMagneticStrengthTheoretic) |
307 | { |
307 | { |
308 | MinCaclibration = (MinCaclibration * EarthMagneticStrengthTheoretic) / 50; |
308 | MinCaclibration = (MinCaclibration * EarthMagneticStrengthTheoretic) / 50; |
309 | sprintf(msg, "Earth field on your location should be: %iuT\r\n",EarthMagneticStrengthTheoretic); |
309 | sprintf(msg, "Earth field on your location should be: %iuT\r\n",EarthMagneticStrengthTheoretic); |
310 | UART1_PutString(msg); |
310 | UART1_PutString(msg); |
311 | } |
311 | } |
312 | else UART1_PutString("without GPS\n\r"); |
312 | else UART1_PutString("without GPS\r\n"); |
313 | } |
313 | } |
314 | x_max = -30000; y_max = -30000; z_max = -30000; |
314 | x_max = -30000; y_max = -30000; z_max = -30000; |
315 | x_min = 30000; y_min = 30000; z_min = 30000; |
315 | x_min = 30000; y_min = 30000; z_min = 30000; |
316 | speak = 1; |
316 | speak = 1; |
317 | break; |
317 | break; |
Line 335... | Line 335... | ||
335 | case 5: |
335 | case 5: |
336 | if(last_state == Compass_CalState) break; |
336 | if(last_state == Compass_CalState) break; |
337 | if(((x_max - x_min) > MinCaclibration) && ((y_max - y_min) > MinCaclibration) && ((z_max - z_min) > MinCaclibration)) |
337 | if(((x_max - x_min) > MinCaclibration) && ((y_max - y_min) > MinCaclibration) && ((z_max - z_min) > MinCaclibration)) |
338 | { |
338 | { |
339 | BeepTime = 2500; |
339 | BeepTime = 2500; |
340 | UART1_PutString("\r\n-> Calibration okay <-\n\r"); |
340 | UART1_PutString("\r\n-> Calibration okay <-\r\n"); |
341 | SpeakHoTT = SPEAK_MIKROKOPTER; |
341 | SpeakHoTT = SPEAK_MIKROKOPTER; |
342 | } |
342 | } |
343 | else |
343 | else |
344 | { |
344 | { |
345 | UART1_PutString("\r\nCalibration FAILED - Values too low: "); |
345 | UART1_PutString("\r\nCalibration FAILED - Values too low: "); |