From: Bdale Garbee Date: Wed, 26 Feb 2020 06:57:31 +0000 (-0700) Subject: Merge branch 'master' into branch-1.9 X-Git-Tag: 1.9.2~1 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=28e77f3520095a1e47ab25721b186e42110ffd3e;hp=c6ea266630b9eef7a80e267a4430d22d50954908;p=fw%2Faltos Merge branch 'master' into branch-1.9 --- diff --git a/doc/telelaunch.txt b/doc/telelaunch.txt index 4deee3a9..7522b983 100644 --- a/doc/telelaunch.txt +++ b/doc/telelaunch.txt @@ -6,7 +6,7 @@ Bdale Garbee :icons: :icontype: svg :revremark: initial draft -:copyright: Bdale Garbee 2019 +:copyright: Bdale Garbee 2020 :doctype: book :numbered: :stylesheet: am.css diff --git a/libaltos/libaltos_common.c b/libaltos/libaltos_common.c index 6f0cbe61..fb8c314e 100644 --- a/libaltos/libaltos_common.c +++ b/libaltos/libaltos_common.c @@ -117,16 +117,12 @@ int altos_bt_port(struct altos_bt_device *device) { return BT_PORT_DEFAULT; } -#include - PUBLIC void altos_free(struct altos_file *file) { int i; altos_close(file); - for (i = 0; i < 10 && file->busy; i++) { - struct timespec delay = { .tv_sec = 1, .tv_nsec = 0 }; - nanosleep(&delay, NULL); - } + for (i = 0; i < 10 && file->busy; i++) + altos_pause_one_second(); free(file); } diff --git a/libaltos/libaltos_posix.c b/libaltos/libaltos_posix.c index bf5d4699..97eedd3b 100644 --- a/libaltos/libaltos_posix.c +++ b/libaltos/libaltos_posix.c @@ -200,3 +200,11 @@ altos_fill(struct altos_file *file_common, int timeout) return 0; } +#include + +void +altos_pause_one_second(void) +{ + struct timespec delay = { .tv_sec = 1, .tv_nsec = 0 }; + nanosleep(&delay, NULL); +} diff --git a/libaltos/libaltos_private.h b/libaltos/libaltos_private.h index 45e141f9..f356eb6b 100644 --- a/libaltos/libaltos_private.h +++ b/libaltos/libaltos_private.h @@ -65,4 +65,7 @@ altos_fill(struct altos_file *file, int timeout); int altos_bt_port(struct altos_bt_device *device); +void +altos_pause_one_second(void); + #endif /* _LIBALTOS_PRIVATE_H_ */ diff --git a/libaltos/libaltos_windows.c b/libaltos/libaltos_windows.c index 846e2217..03c2958f 100644 --- a/libaltos/libaltos_windows.c +++ b/libaltos/libaltos_windows.c @@ -760,3 +760,9 @@ altos_bt_open(struct altos_bt_device *device) } return &file->file; } + +void +altos_pause_one_second(void) +{ + Sleep(1000); +}