From a24cfbac866ba713714dcddb753d4ad808d200c6 Mon Sep 17 00:00:00 2001 From: Etienne Wodey Date: Sun, 26 Apr 2020 23:02:03 +0200 Subject: host/examples/ascii_art_dft.hpp: fix and modernize example main Refresh screen after printing the DFT data. Use C++14 std::this_thread::sleep_for to control the refresh rate. Signed-off-by: Etienne Wodey --- host/examples/ascii_art_dft.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'host/examples') diff --git a/host/examples/ascii_art_dft.hpp b/host/examples/ascii_art_dft.hpp index 7dddad42e..fe411e400 100644 --- a/host/examples/ascii_art_dft.hpp +++ b/host/examples/ascii_art_dft.hpp @@ -319,8 +319,12 @@ std::string dft_to_plot(const log_pwr_dft_type& dft_, #include #include #include +#include +#include int main(void){ + using namespace std::chrono_literals; + initscr(); while (true){ @@ -343,8 +347,9 @@ int main(void){ 12.5e4, 2.45e9, 60, 0 ).c_str()); + refresh(); - sleep(1); + std::this_thread::sleep_for(1s); } -- cgit v1.2.3