hello linux delay thread
This commit is contained in:
parent
273a477a37
commit
f653fe0914
2 changed files with 1 additions and 5 deletions
|
@ -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];
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
#include <cstdio>
|
||||
#include <mutex>
|
||||
#include "utils.h"
|
||||
static std::mutex Mutex;
|
||||
|
||||
void print_morse_table (const TABLE<unsigned char, 64> & 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<unsigned char, 64> & tab) {
|
|||
n++;
|
||||
}
|
||||
printf("\n};\n");
|
||||
Mutex.unlock();
|
||||
}
|
||||
void print_sinus_table (const TABLE<unsigned short, 256> & 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<unsigned short, 256> & tab) {
|
|||
n++;
|
||||
}
|
||||
printf("\n};\n");
|
||||
Mutex.unlock();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue