diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-15 07:43:17 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-15 07:43:17 +0100 |
commit | f3cd83e804e8fffc5e71e4d6443729184b3e7909 (patch) | |
tree | 13ac8af24705fe5f8107f3f46fd989e49fdd00d4 /src/modules/px4iofirmware/px4io.c | |
parent | 9612514a3f59cfedbd7b29c9e4f30c1edf1c7345 (diff) | |
parent | cd72f564eff13d831d6773e85818b65f708d3323 (diff) | |
download | px4-firmware-f3cd83e804e8fffc5e71e4d6443729184b3e7909.tar.gz px4-firmware-f3cd83e804e8fffc5e71e4d6443729184b3e7909.tar.bz2 px4-firmware-f3cd83e804e8fffc5e71e4d6443729184b3e7909.zip |
Merged master into mixer unit tests branch
Diffstat (limited to 'src/modules/px4iofirmware/px4io.c')
-rw-r--r-- | src/modules/px4iofirmware/px4io.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index 745bd5705..0b8c4a6a8 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -125,6 +125,25 @@ heartbeat_blink(void) LED_BLUE(heartbeat = !heartbeat); } +static uint64_t reboot_time; + +/** + schedule a reboot in time_delta_usec microseconds + */ +void schedule_reboot(uint32_t time_delta_usec) +{ + reboot_time = hrt_absolute_time() + time_delta_usec; +} + +/** + check for a scheduled reboot + */ +static void check_reboot(void) +{ + if (reboot_time != 0 && hrt_absolute_time() > reboot_time) { + up_systemreset(); + } +} static void calculate_fw_crc(void) @@ -249,6 +268,8 @@ user_start(int argc, char *argv[]) heartbeat_blink(); } + check_reboot(); + #if 0 /* check for debug activity */ show_debug_messages(); |