Rev 209 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 209 | Rev 224 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | */ |
11 | */ |
12 | /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
12 | /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
13 | Peter Muehlenbrock |
13 | Peter Muehlenbrock |
14 | Auswertung der Daten vom GPS im ublox Format |
14 | Auswertung der Daten vom GPS im ublox Format |
15 | Hold Modus mit PID Regler |
15 | Hold Modus mit PID Regler |
- | 16 | Komm heim zu Papi Funktion |
|
16 | Stand 2.10.2007 |
17 | Stand 5.10.2007 |
17 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
18 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
18 | */ |
19 | */ |
19 | #include "main.h" |
20 | #include "main.h" |
20 | //#include "gps.h" |
21 | //#include "gps.h" |
Line 42... | Line 43... | ||
42 | signed int GPS_Nick = 0; |
43 | signed int GPS_Nick = 0; |
43 | signed int GPS_Roll = 0; |
44 | signed int GPS_Roll = 0; |
44 | short int ublox_msg_state = UBLOX_IDLE; |
45 | short int ublox_msg_state = UBLOX_IDLE; |
45 | static uint8_t chk_a =0; //Checksum |
46 | static uint8_t chk_a =0; //Checksum |
46 | static uint8_t chk_b =0; |
47 | static uint8_t chk_b =0; |
47 | short int gps_state; |
48 | short int gps_state,gps_sub_state; |
48 | short int gps_updte_flag; |
49 | short int gps_updte_flag; |
49 | signed int GPS_hdng_abs_2trgt; //Winkel zum Ziel bezogen auf Nordpol |
50 | signed int GPS_hdng_abs_2trgt; //Winkel zum Ziel bezogen auf Nordpol |
50 | signed int GPS_hdng_rel_2trgt; //Winkel zum Ziel bezogen auf Nordachse des Kopters |
51 | signed int GPS_hdng_rel_2trgt; //Winkel zum Ziel bezogen auf Nordachse des Kopters |
51 | signed int GPS_dist_2trgt; //vorzeichenlose Distanz zum Ziel |
52 | signed int GPS_dist_2trgt; //vorzeichenlose Distanz zum Ziel |
52 | signed int gps_int_x,gps_int_y,gps_reg_x,gps_reg_y; |
53 | signed int gps_int_x,gps_int_y,gps_reg_x,gps_reg_y; |
53 | static unsigned int rx_len; |
54 | static unsigned int rx_len; |
54 | static unsigned int ptr_payload_data_end; |
55 | static unsigned int ptr_payload_data_end; |
55 | unsigned int gps_alive_cnt; // Wird bei jedem gueltigen GPS Telegramm hochgezaehlt |
56 | unsigned int gps_alive_cnt; // Wird bei jedem gueltigen GPS Telegramm hochgezaehlt |
- | 57 | signed hdng_2home,dist_2home; //Richtung und Entfernung zur home Position |
|
- | 58 | signed gps_tick; //wird bei jedem Update durch das GPS Modul hochgezaehlt |
|
Line 56... | Line 59... | ||
56 | 59 | ||
57 | static uint8_t *ptr_payload_data; |
60 | static uint8_t *ptr_payload_data; |
Line -... | Line 61... | ||
- | 61 | static uint8_t *ptr_pac_status; |
|
- | 62 | ||
58 | static uint8_t *ptr_pac_status; |
63 | long int dist_flown,dist_frm_start_east,dist_frm_start_north; |
Line 59... | Line 64... | ||
59 | 64 | ||
60 | short int Get_GPS_data(void); |
65 | short int Get_GPS_data(void); |
61 | 66 | ||
Line 62... | Line 67... | ||
62 | NAV_POSUTM_t actual_pos; // Aktuelle Nav Daten werden hier im ublox Format abgelegt |
67 | NAV_POSUTM_t actual_pos; // Aktuelle Nav Daten werden hier im ublox Format abgelegt |
63 | NAV_STATUS_t actual_status; // Aktueller Nav Status |
68 | NAV_STATUS_t actual_status; // Aktueller Nav Status |
64 | NAV_VELNED_t actual_speed; // Aktueller Geschwindigkeits und Richtungsdaten |
69 | NAV_VELNED_t actual_speed; // Aktueller Geschwindigkeits und Richtungsdaten |
65 | 70 | ||
- | 71 | GPS_ABS_POSITION_t gps_act_position; // Alle wichtigen Daten zusammengefasst |
|
Line 66... | Line 72... | ||
66 | GPS_ABS_POSITION_t gps_act_position; // Alle wichtigen Daten zusammengefasst |
72 | GPS_ABS_POSITION_t gps_home_position; // Die Startposition, beim Kalibrieren ermittelt |
67 | GPS_ABS_POSITION_t gps_home_position; // Die Startposition, beim Kalibrieren ermittelt |
73 | GPS_REL_POSITION_t gps_rel_act_position; // Die aktuelle relative Position bezogen auf Home Position |
68 | GPS_REL_POSITION_t gps_rel_act_position; // Die aktuelle relative Position bezogen auf Home Position |
74 | GPS_REL_POSITION_t gps_rel_hold_position; // Die gespeicherte Sollposition fuer GPS_ Hold Mode |
69 | GPS_REL_POSITION_t gps_rel_hold_position; // Die gespeicherte Sollposition fuer GPS_ Hold Mode |
75 | GPS_REL_POSITION_t gps_rel_start_position; // Die gespeicherte Ausgangsposition fuer GPS_ Home Mode |
Line 107... | Line 113... | ||
107 | short int Get_Rel_Position(void) |
113 | short int Get_Rel_Position(void) |
108 | { |
114 | { |
109 | short int n = 0; |
115 | short int n = 0; |
110 | n = Get_GPS_data(); |
116 | n = Get_GPS_data(); |
111 | if (n >=1) return (n); // nix zu tun, weil keine neue Daten da sind |
117 | if (n >=1) return (n); // nix zu tun, weil keine neue Daten da sind |
112 | if (gps_alive_cnt < 400) gps_alive_cnt += 300; // Timeoutzaehler. Wird in MotorreglerRoutine ueberwacht und dekrementiert |
118 | if (gps_alive_cnt < 400) gps_alive_cnt += 300; // Timeoutzaehler. Wird in Motorregler Routine ueberwacht und dekrementiert |
113 | if (gps_home_position.status > 0) //Nur wenn Home Position vorliegt |
119 | if (gps_home_position.status > 0) //Nur wenn Home Position vorliegt |
114 | { |
120 | { |
115 | gps_rel_act_position.utm_east = (int) (gps_act_position.utm_east - gps_home_position.utm_east); |
121 | gps_rel_act_position.utm_east = (int) (gps_act_position.utm_east - gps_home_position.utm_east); |
116 | gps_rel_act_position.utm_north = (int) (gps_act_position.utm_north - gps_home_position.utm_north); |
122 | gps_rel_act_position.utm_north = (int) (gps_act_position.utm_north - gps_home_position.utm_north); |
117 | gps_rel_act_position.status = 1; // gueltige Positionsdaten |
123 | gps_rel_act_position.status = 1; // gueltige Positionsdaten |
Line 286... | Line 292... | ||
286 | static signed int dist_north,dist_east; |
292 | static signed int dist_north,dist_east; |
287 | static signed int diff_east,diff_north; // Differenzierer (Differenz zum vorhergehenden x bzw. y Wert) |
293 | static signed int diff_east,diff_north; // Differenzierer (Differenz zum vorhergehenden x bzw. y Wert) |
288 | static signed int diff_east_f,diff_north_f; // Differenzierer, gefiltert |
294 | static signed int diff_east_f,diff_north_f; // Differenzierer, gefiltert |
289 | signed int n,diff_v; |
295 | signed int n,diff_v; |
290 | long signed int dev,n_l; |
296 | long signed int dev,n_l; |
- | 297 | ||
291 | switch (cmd) |
298 | switch (cmd) |
292 | { |
299 | { |
Line 293... | Line 300... | ||
293 | 300 | ||
- | 301 | case GPS_CMD_REQ_HOME: // Es soll zum Startpunkt zurueckgeflogen werden. |
|
- | 302 | if ((gps_state != GPS_CRTL_HOLD_ACTIVE) && (gps_state != GPS_CRTL_HOME_ACTIVE)) |
|
- | 303 | { |
|
- | 304 | cnt++; |
|
- | 305 | if (cnt > 500) // erst nach Verzoegerung |
|
- | 306 | { |
|
- | 307 | // Erst mal initialisieren |
|
- | 308 | cnt = 0; |
|
- | 309 | gps_tick = 0; |
|
- | 310 | int_east = 0, int_north = 0; |
|
- | 311 | gps_reg_x = 0, gps_reg_y = 0; |
|
- | 312 | dist_east = 0, dist_north = 0; |
|
- | 313 | diff_east_f = 0, diff_north_f= 0; |
|
- | 314 | diff_east = 0, diff_north = 0; |
|
- | 315 | dist_flown = 0; |
|
- | 316 | gps_sub_state = GPS_CRTL_IDLE; |
|
- | 317 | // aktuelle positionsdaten abspeichern |
|
- | 318 | if (gps_rel_act_position.status > 0) |
|
- | 319 | { |
|
- | 320 | gps_rel_start_position.utm_east = gps_rel_act_position.utm_east; |
|
- | 321 | gps_rel_start_position.utm_north= gps_rel_act_position.utm_north; |
|
- | 322 | gps_rel_start_position.status = 1; // gueltige Positionsdaten |
|
- | 323 | gps_rel_hold_position.utm_east = gps_rel_act_position.utm_east; |
|
- | 324 | gps_rel_hold_position.utm_north = gps_rel_act_position.utm_north; |
|
- | 325 | gps_rel_hold_position.status = 1; // gueltige Positionsdaten |
|
- | 326 | //Richtung zur Home Positionbezogen auf Nordpol bestimmen |
|
294 | case GPS_CMD_REQ_HOME: // Es soll zum Startpunkt zurueckgeflogen werden. |
327 | hdng_2home = arctan_i(-gps_rel_start_position.utm_east,-gps_rel_start_position.utm_north); |
- | 328 | // in Winkel 0...360 Grad umrechnen |
|
- | 329 | if ((-gps_rel_start_position.utm_east >= 0)) hdng_2home = ( 90-hdng_2home); |
|
- | 330 | else hdng_2home = (270 - hdng_2home); |
|
- | 331 | dist_2home = (int) get_dist(gps_rel_start_position.utm_east,gps_rel_start_position.utm_north,hdng_2home); //Entfernung zur Home Position bestimmen |
|
- | 332 | gps_state = GPS_CRTL_HOME_ACTIVE; |
|
- | 333 | return (GPS_STST_OK); |
|
- | 334 | } |
|
- | 335 | else |
|
- | 336 | { |
|
- | 337 | gps_rel_start_position.status = 0; //Keine Daten verfuegbar |
|
- | 338 | gps_state = GPS_CRTL_IDLE; |
|
- | 339 | return(GPS_STST_ERR); // Keine Daten da |
|
- | 340 | } |
|
295 | // Noch einiges zu ueberlegen und zu tun |
341 | } |
- | 342 | else return(GPS_STST_PEND); // noch warten |
|
296 | return(GPS_STST_PEND); // noch warten |
343 | } |
297 | break; |
344 | break; |
Line 298... | Line 345... | ||
298 | // ****************************** |
345 | // ****************************** |
299 | 346 | ||
300 | case GPS_CMD_REQ_HOLD: // Die Lageregelung soll aktiviert werden. |
347 | case GPS_CMD_REQ_HOLD: // Die Lageregelung soll aktiviert werden. |
301 | if (gps_state != GPS_CRTL_HOLD_ACTIVE) |
348 | if (gps_state != GPS_CRTL_HOLD_ACTIVE) |
302 | { |
349 | { |
303 | cnt++; |
350 | cnt++; |
304 | if (cnt > 500) // erst nach Verzoegerung |
351 | if (cnt > 500) // erst nach Verzoegerung |
305 | { |
352 | { |
306 | cnt = 0; |
353 | cnt = 0; |
307 | // aktuelle positionsdaten abespeichern |
354 | // aktuelle positionsdaten abspeichern |
308 | if (gps_rel_act_position.status > 0) |
355 | if (gps_rel_act_position.status > 0) |
309 | { |
- | |
310 | int_east = 0; |
356 | { |
311 | int_north = 0; |
- | |
312 | gps_reg_x = 0; |
357 | int_east = 0, int_north = 0; |
313 | gps_reg_y = 0; |
- | |
314 | dist_east = 0; |
358 | gps_reg_x = 0, gps_reg_y = 0; |
315 | dist_north = 0; |
- | |
316 | diff_east_f = 0; |
- | |
317 | diff_north_f = 0; |
359 | dist_east = 0, dist_north = 0; |
318 | diff_east = 0; |
360 | diff_east_f = 0, diff_north_f= 0; |
319 | diff_north = 0; |
361 | diff_east = 0, diff_north = 0; |
320 | gps_rel_hold_position.utm_east = gps_rel_act_position.utm_east; |
362 | gps_rel_hold_position.utm_east = gps_rel_act_position.utm_east; |
321 | gps_rel_hold_position.utm_north = gps_rel_act_position.utm_north; |
363 | gps_rel_hold_position.utm_north = gps_rel_act_position.utm_north; |
322 | gps_rel_hold_position.status = 1; // gueltige Positionsdaten |
364 | gps_rel_hold_position.status = 1; // gueltige Positionsdaten |
Line 354... | Line 396... | ||
354 | case GPS_CRTL_IDLE: |
396 | case GPS_CRTL_IDLE: |
355 | cnt = 0; |
397 | cnt = 0; |
356 | return (GPS_STST_OK); |
398 | return (GPS_STST_OK); |
357 | break; |
399 | break; |
Line -... | Line 400... | ||
- | 400 | ||
- | 401 | case GPS_CRTL_HOME_ACTIVE: // Rueckflug zur Basis |
|
- | 402 | //Der Sollwert des Lagereglers wird der Homeposition angenaehert |
|
- | 403 | if (gps_rel_start_position.status >0) |
|
- | 404 | { |
|
- | 405 | if ((gps_updte_flag > 0) && (gps_sub_state !=GPS_HOME_FINISHED)) // nur wenn neue GPS Daten vorliegen und nicht schon alles fertig ist |
|
- | 406 | { |
|
- | 407 | gps_tick++; |
|
- | 408 | int d1,d2,d3; |
|
- | 409 | d3 = (dist_2home - (int)dist_flown); // Restdistanz zum Ziel |
|
- | 410 | d1 = abs (gps_rel_hold_position.utm_east - gps_rel_act_position.utm_east ); |
|
- | 411 | d2 = abs (gps_rel_hold_position.utm_north - gps_rel_act_position.utm_north ); |
|
- | 412 | ||
- | 413 | if (d3 > GPS_G2T_DIST_MAX_STOP) |
|
- | 414 | { |
|
- | 415 | if ((d1 < GPS_G2T_TOL) && (d2 < GPS_G2T_TOL)) //nur weiter wenn Lage innerhalb der Toleranz |
|
- | 416 | { |
|
- | 417 | dist_flown += (GPS_G2T_V_MAX); // Vorgabe der Strecke anhand der Geschwindigkeit |
|
- | 418 | dist_frm_start_east = (dist_flown * (long)sin_i(hdng_2home))/1000; |
|
- | 419 | dist_frm_start_north = (dist_flown * (long)cos_i(hdng_2home))/1000; |
|
- | 420 | gps_rel_hold_position.utm_north = gps_rel_start_position.utm_north + (int)dist_frm_start_north; //naechster Zielpunkt |
|
- | 421 | gps_rel_hold_position.utm_east = gps_rel_start_position.utm_east + (int)dist_frm_start_east; //naechster Zielpunkt |
|
- | 422 | } |
|
- | 423 | } |
|
- | 424 | else //Schon ziemlich nahe am Ziel, deswegen abbremsen |
|
- | 425 | { |
|
- | 426 | if ((d1 < GPS_G2T_TOL) && (d2 < GPS_G2T_TOL)) //nur weiter wenn Lage innerhalb der Toleranz |
|
- | 427 | { |
|
- | 428 | if (d3 > 0) |
|
- | 429 | { |
|
- | 430 | dist_flown += GPS_G2T_V_RAMP_DWN; // Vorgabe der Strecke anhand der Geschwindigkeit |
|
- | 431 | dist_frm_start_east = (dist_flown * (long)sin_i(hdng_2home))/1000; |
|
- | 432 | dist_frm_start_north = (dist_flown * (long)cos_i(hdng_2home))/1000; |
|
- | 433 | gps_rel_hold_position.utm_north = gps_rel_start_position.utm_north + (int)dist_frm_start_north; //naechster Zielpunkt |
|
- | 434 | gps_rel_hold_position.utm_east = gps_rel_start_position.utm_east + (int)dist_frm_start_east; //naechster Zielpunkt |
|
- | 435 | } |
|
- | 436 | else //Ziel erreicht, Regelung beenden |
|
- | 437 | { |
|
- | 438 | gps_rel_hold_position.utm_east = 0; |
|
- | 439 | gps_rel_hold_position.utm_north = 0; |
|
- | 440 | gps_sub_state = GPS_HOME_FINISHED; |
|
- | 441 | } |
|
- | 442 | } |
|
- | 443 | ||
- | 444 | } |
|
- | 445 | gps_state = GPS_CRTL_HOLD_ACTIVE; //Zwischensprung |
|
- | 446 | return (GPS_STST_OK); |
|
- | 447 | } |
|
- | 448 | else return (GPS_STST_OK); |
|
- | 449 | } |
|
- | 450 | else |
|
- | 451 | { |
|
- | 452 | gps_state = GPS_CRTL_IDLE; //Abbruch |
|
- | 453 | return (GPS_STST_ERR); |
|
- | 454 | } |
|
- | 455 | break; |
|
- | 456 | ||
358 | 457 | ||
359 | case GPS_CRTL_HOLD_ACTIVE: // Hier werden die Daten fuer Nick und Roll errechnet |
458 | case GPS_CRTL_HOLD_ACTIVE: // Hier werden die Daten fuer Nick und Roll errechnet |
360 | if (gps_updte_flag == 1) //nur wenn neue GPS Daten vorliegen |
459 | if (gps_updte_flag >0) // nur wenn neue GPS Daten vorliegen |
361 | { |
460 | { |
362 | gps_updte_flag = 0; |
461 | gps_updte_flag = 0; |
363 | // ab hier wird geregelt |
462 | // ab hier wird geregelt |
364 | diff_east = -dist_east; //Alten Wert fuer Differenzier schon mal abziehen |
463 | diff_east = -dist_east; //Alten Wert fuer Differenzier schon mal abziehen |
Line 367... | Line 466... | ||
367 | dist_north = gps_rel_hold_position.utm_north - gps_rel_act_position.utm_north; |
466 | dist_north = gps_rel_hold_position.utm_north - gps_rel_act_position.utm_north; |
368 | int_east += dist_east; |
467 | int_east += dist_east; |
369 | int_north += dist_north; |
468 | int_north += dist_north; |
370 | diff_east += dist_east; // Differenz zur vorhergehenden East Position |
469 | diff_east += dist_east; // Differenz zur vorhergehenden East Position |
371 | diff_north += dist_north; // Differenz zur vorhergehenden North Position |
470 | diff_north += dist_north; // Differenz zur vorhergehenden North Position |
372 | 471 | /* |
|
373 | diff_east_f = ((diff_east_f )/4) + (diff_east*3/4); //Differenzierer filtern |
472 | diff_east_f = ((diff_east_f )/4) + (diff_east*3/4); //Differenzierer filtern |
374 | diff_north_f = ((diff_north_f)/4) + (diff_north*3/4); //Differenzierer filtern |
473 | diff_north_f = ((diff_north_f)/4) + (diff_north*3/4); //Differenzierer filtern |
375 | 474 | */ |
|
376 | #define GPSINT_MAX 2048 //neuer Wert ab 1.10.2007 Begrenzung |
475 | #define GPSINT_MAX 2048 //neuer Wert ab 1.10.2007 Begrenzung |
377 | if ((abs(int_east) > GPSINT_MAX) || (abs(int_north)> GPSINT_MAX)) //Bei zu hohem Wert Integrator auf Wert halten |
476 | if ((abs(int_east) > GPSINT_MAX) || (abs(int_north)> GPSINT_MAX)) //Bei zu hohem Wert Integrator auf Wert halten |
378 | { |
477 | { |
379 | int_east -= dist_east; |
478 | int_east -= dist_east; |
380 | int_north -= dist_north; |
479 | int_north -= dist_north; |
Line 384... | Line 483... | ||
384 | #define GPS_DIFF_MAX_V 20 //maximale Verstaerkung * 10 |
483 | #define GPS_DIFF_MAX_V 20 //maximale Verstaerkung * 10 |
385 | #define GPS_DIFF_MAX_D 30 //Entfernung bei der maximale Verstaerkung erreicht wird in 10cm |
484 | #define GPS_DIFF_MAX_D 30 //Entfernung bei der maximale Verstaerkung erreicht wird in 10cm |
386 | signed long dist; |
485 | signed long dist; |
387 | int phi; |
486 | int phi; |
388 | phi = arctan_i(abs(dist_north),abs(dist_east)); |
487 | phi = arctan_i(abs(dist_north),abs(dist_east)); |
389 | if (abs(dist_east) > abs(dist_north) ) //Zunaechst Entfernung zum Ziel ermitteln |
488 | dist = get_dist(dist_east,dist_north,phi); //Zunaechst Entfernung zum Ziel ermitteln |
390 | { |
- | |
391 | dist = (long)dist_east; //Groesseren Wert wegen besserer Genauigkeit nehmen |
- | |
392 | dist = abs((dist *1000) / (long) sin_i(phi)); |
- | |
393 | } |
- | |
394 | else |
- | |
395 | { |
- | |
396 | dist = (long)dist_north; |
- | |
397 | dist = abs((dist *1000) / (long) cos_i(phi)); |
- | |
398 | } |
489 | |
399 | diff_v = (int)((dist * (GPS_DIFF_MAX_V - 10)) / GPS_DIFF_MAX_D) +10; //Verstaerkung * 10 |
490 | diff_v = (int)((dist * (GPS_DIFF_MAX_V - 10)) / GPS_DIFF_MAX_D) +10; //Verstaerkung * 10 |
400 | if (diff_v > GPS_DIFF_MAX_V) diff_v = GPS_DIFF_MAX_V; //begrenzen |
491 | if (diff_v > GPS_DIFF_MAX_V) diff_v = GPS_DIFF_MAX_V; //begrenzen |
Line 401... | Line 492... | ||
401 | 492 | ||
402 | //PID Regler Werte aufsummieren |
493 | //PID Regler Werte aufsummieren |
403 | gps_reg_x = ((int_east * Parameter_UserParam2)/32) + ((dist_east * Parameter_UserParam1)/8)+ ((diff_east_f * diff_v * Parameter_UserParam3)/10); // I + P +D Anteil X Achse |
494 | gps_reg_x = ((int_east * Parameter_UserParam2)/32) + ((dist_east * Parameter_UserParam1)/8)+ ((diff_east * diff_v * Parameter_UserParam3)/10); // I + P +D Anteil X Achse |
Line 404... | Line 495... | ||
404 | gps_reg_y = ((int_north * Parameter_UserParam2)/32) + ((dist_north * Parameter_UserParam1)/8)+ ((diff_north_f * diff_v * Parameter_UserParam3)/10); // I + P +D Anteil Y Achse |
495 | gps_reg_y = ((int_north * Parameter_UserParam2)/32) + ((dist_north * Parameter_UserParam1)/8)+ ((diff_north * diff_v * Parameter_UserParam3)/10); // I + P +D Anteil Y Achse |
405 | 496 | ||
Line 406... | Line 497... | ||
406 | //Ziel-Richtung bezogen auf Nordpol bestimmen |
497 | //Ziel-Richtung bezogen auf Nordpol bestimmen |
Line 453... | Line 544... | ||
453 | GPS_Nick = 0; |
544 | GPS_Nick = 0; |
454 | gps_state = GPS_CRTL_IDLE; |
545 | gps_state = GPS_CRTL_IDLE; |
455 | return (GPS_STST_ERR); |
546 | return (GPS_STST_ERR); |
456 | break; |
547 | break; |
457 | } |
548 | } |
- | 549 | else |
|
- | 550 | { |
|
- | 551 | if ( cmd == GPS_CMD_REQ_HOME ) gps_state = GPS_CRTL_HOME_ACTIVE; // State umsetzen |
|
- | 552 | return (GPS_STST_OK); |
|
- | 553 | } |
|
- | 554 | } |
|
- | 555 | else |
|
- | 556 | { |
|
- | 557 | if ( cmd == GPS_CMD_REQ_HOME ) gps_state = GPS_CRTL_HOME_ACTIVE; // State umsetzen |
|
- | 558 | return (GPS_STST_OK); |
|
458 | } |
559 | } |
459 | else return (GPS_STST_OK); |
- | |
460 | break; |
560 | break; |
Line 461... | Line 561... | ||
461 | 561 | ||
462 | default: |
562 | default: |
463 | gps_state = GPS_CRTL_IDLE; |
563 | gps_state = GPS_CRTL_IDLE; |
464 | return (GPS_STST_ERR); |
564 | return (GPS_STST_ERR); |
465 | break; |
565 | break; |
466 | } |
566 | } |