From f653fe0914d712be03adc7f1c938fad7decd3794 Mon Sep 17 00:00:00 2001 From: Kizarm Date: Sun, 18 Aug 2024 21:29:44 +0200 Subject: [PATCH] hello linux delay thread --- V203/hello/linux/alsasound.cpp | 1 + V203/hello/linux/print.cpp | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/V203/hello/linux/alsasound.cpp b/V203/hello/linux/alsasound.cpp index f0d6b64..e10f704 100644 --- a/V203/hello/linux/alsasound.cpp +++ b/V203/hello/linux/alsasound.cpp @@ -55,6 +55,7 @@ static constexpr int CC = MAXPWM / 2; static pthread_t rc; void * WriteHandler (void * data) { + usleep(10'000); printf ("Start thread\n"); PwmClass * pA = (PwmClass *) data; Sample buf [BufLen]; diff --git a/V203/hello/linux/print.cpp b/V203/hello/linux/print.cpp index a97c2e1..37505d8 100644 --- a/V203/hello/linux/print.cpp +++ b/V203/hello/linux/print.cpp @@ -1,10 +1,8 @@ #include #include #include "utils.h" -static std::mutex Mutex; void print_morse_table (const TABLE & tab) { - Mutex.lock(); int n = 0; printf("static const unsigned char compressed_table [] = {"); for (auto & e: tab) { @@ -13,10 +11,8 @@ void print_morse_table (const TABLE & tab) { n++; } printf("\n};\n"); - Mutex.unlock(); } void print_sinus_table (const TABLE & tab) { - Mutex.lock(); int n = 0; printf("static const uint16_t sin_tab [] = {"); for (auto & e: tab) { @@ -25,5 +21,4 @@ void print_sinus_table (const TABLE & tab) { n++; } printf("\n};\n"); - Mutex.unlock(); }