mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 06:03:35 +08:00
Updated PX4 use / API of low level GPIO and other hardware-centric system facilities
This commit is contained in:
@@ -121,12 +121,12 @@ int test_time(int argc, char *argv[])
|
||||
delta = 0;
|
||||
|
||||
for (unsigned i = 0; i < 100; i++) {
|
||||
uint32_t flags = irqsave();
|
||||
uint32_t flags = px4_enter_critical_section();
|
||||
|
||||
h = hrt_absolute_time();
|
||||
c = cycletime();
|
||||
|
||||
irqrestore(flags);
|
||||
px4_leave_critical_section(flags);
|
||||
|
||||
delta += h - c;
|
||||
}
|
||||
@@ -138,12 +138,12 @@ int test_time(int argc, char *argv[])
|
||||
|
||||
usleep(rand());
|
||||
|
||||
uint32_t flags = irqsave();
|
||||
uint32_t flags = px4_enter_critical_section();
|
||||
|
||||
c = cycletime();
|
||||
h = hrt_absolute_time();
|
||||
|
||||
irqrestore(flags);
|
||||
px4_leave_critical_section(flags);
|
||||
|
||||
delta = abs(h - c);
|
||||
deltadelta = abs(delta - lowdelta);
|
||||
|
||||
Reference in New Issue
Block a user