Răsfoiți Sursa

Further cleanup

k4be 1 an în urmă
părinte
comite
b98b9cb7a0
2 a modificat fișierele cu 14 adăugiri și 12 ștergeri
  1. 11 11
      soft/main.c
  2. 3 1
      soft/settings.c

+ 11 - 11
soft/main.c

@@ -293,19 +293,19 @@ static inline void auto_pause_process(void) {
 	if (System.speed >= System.conf.auto_pause_speed) { /* immediately unpause when set speed is exceeded */
 		auto_pause.point_counter = 0;
 		auto_unpause();
+		return;
+	}
+	if (++auto_pause.point_counter < System.conf.auto_pause_time)
+		return;
+	auto_pause.point_counter = 0;
+	if ((System.distance - auto_pause.prev_distance)/100 > System.conf.auto_pause_dist) {
+		if (System.tracking_auto_paused)
+			auto_unpause(); /* unpause when distance exceeded */
 	} else {
-		if (++auto_pause.point_counter < System.conf.auto_pause_time)
-			return;
-		auto_pause.point_counter = 0;
-		if ((System.distance - auto_pause.prev_distance)/100 > System.conf.auto_pause_dist) {
-			if (System.tracking_auto_paused)
-				auto_unpause(); /* unpause when distance not too low */
-		} else {
-			if (!System.tracking_auto_paused)
-				auto_pause_activate(); /* pause otherwise */
-		}
-		auto_pause.prev_distance = System.distance;
+		if (!System.tracking_auto_paused)
+			auto_pause_activate(); /* pause otherwise */
 	}
+	auto_pause.prev_distance = System.distance;
 }
 
 __flash const char __open_msg[] = "Open %s\r\n";

+ 3 - 1
soft/settings.c

@@ -113,6 +113,7 @@ __flash const char _msg_enable_sbas[] = "Szukaj SBAS";
 __flash const char _msg_gnss_type[] = "Rodzaj GNSS";
 __flash const char _msg_skip_points[] = "Pomin punkty";
 __flash const char _msg_logging_after_boot[] = "Zapis po wlacz.";
+__flash const char _msg_settings[] = "Ustawienia";
 __flash const char _msg_back[] = "< Powrot";
 __flash const char _msg_auto_pause[] = "Autopauza";
 __flash const char _msg_auto_pause_time[] = "Autopauza czas";
@@ -124,7 +125,8 @@ __flash const struct menu_pos settings_menu_list[] = {
 	{
 		.type = MENU_TYPE_DISPLAY,
 		.display_type = MENU_DISPLAY_TYPE_STRING,
-		.name = _msg_back,
+		.name = _msg_settings,
+		.value = _msg_back,
 		.allow_back = 1,
 	},
 	{