aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debug/PX454
-rw-r--r--apps/mavlink/waypoints.c7
-rw-r--r--apps/px4/tests/test_jig_voltages.c4
3 files changed, 60 insertions, 5 deletions
diff --git a/Debug/PX4 b/Debug/PX4
new file mode 100644
index 000000000..7d5905939
--- /dev/null
+++ b/Debug/PX4
@@ -0,0 +1,54 @@
+#
+# Various PX4-specific macros
+#
+source Debug/NuttX
+
+echo Loading PX4 GDB macros. Use 'help px4' for more information.\n
+
+define px4
+ echo Use 'help px4' for more information.\n
+end
+
+document px4
+. Various macros for working with the PX4 firmware.
+.
+. perf
+. Prints the state of all performance counters.
+.
+. Use 'help <macro>' for more specific help.
+end
+
+
+define _perf_print
+ set $hdr = (struct perf_ctr_header *)$arg0
+ printf "%p\n", $hdr
+ printf "%s: ", $hdr->name
+ # PC_COUNT
+ if $hdr->type == 0
+ set $count = (struct perf_ctr_count *)$hdr
+ printf "%llu events,\n", $count->event_count;
+ end
+ # PC_ELPASED
+ if $hdr->type == 1
+ set $elapsed = (struct perf_ctr_elapsed *)$hdr
+ printf "%llu events, %lluus elapsed, min %lluus, max %lluus\n", $elapsed->event_count, $elapsed->time_total, $elapsed->time_least, $elapsed->time_most
+ end
+ # PC_INTERVAL
+ if $hdr->type == 2
+ set $interval = (struct perf_ctr_interval *)$hdr
+ printf "%llu events, %llu avg, min %lluus max %lluus\n", $interval->event_count, ($interval->time_last - $interval->time_first) / $interval->event_count, $interval->time_least, $interval->time_most
+ end
+end
+
+define perf
+ set $ctr = (sq_entry_t *)(perf_counters.head)
+ while $ctr != 0
+ _perf_print $ctr
+ set $ctr = $ctr->flink
+ end
+end
+
+document perf
+. perf
+. Prints performance counters.
+end
diff --git a/apps/mavlink/waypoints.c b/apps/mavlink/waypoints.c
index 3832ebe70..a131b143b 100644
--- a/apps/mavlink/waypoints.c
+++ b/apps/mavlink/waypoints.c
@@ -408,9 +408,10 @@ void check_waypoints_reached(uint64_t now, const struct vehicle_global_position_
cur_wp->current = 0;
if (wpm->current_active_wp_id == wpm->size - 1 && wpm->size > 1) {
- //the last waypoint was reached, if auto continue is
- //activated restart the waypoint list from the beginning
- wpm->current_active_wp_id = 1;
+ /* the last waypoint was reached, if auto continue is
+ * activated restart the waypoint list from the beginning
+ */
+ wpm->current_active_wp_id = 0;
} else {
if ((uint16_t)(wpm->current_active_wp_id + 1) < wpm->size)
diff --git a/apps/px4/tests/test_jig_voltages.c b/apps/px4/tests/test_jig_voltages.c
index ca6d7fb68..10c93b264 100644
--- a/apps/px4/tests/test_jig_voltages.c
+++ b/apps/px4/tests/test_jig_voltages.c
@@ -120,8 +120,8 @@ int test_jig_voltages(int argc, char *argv[])
warnx("\t ADC operational.\n");
/* Expected values */
- int16_t expected_min[] = {2700, 2700, 2200, 2000};
- int16_t expected_max[] = {3000, 3000, 2500, 2200};
+ int16_t expected_min[] = {2800, 2800, 1800, 800};
+ int16_t expected_max[] = {3100, 3100, 2100, 1100};
char *check_res[channels];
if (channels < 4) {