Increased priority of CODEC2 thread, this fixes glitches when generating M17 baseband signal

This commit is contained in:
Silvano Seva 2022-03-28 12:24:26 +02:00
parent 628c341712
commit 83020d4fa3
1 changed files with 6 additions and 0 deletions

View File

@ -237,6 +237,12 @@ void OpMode_M17::startCodec()
pthread_attr_t codecAttr;
pthread_attr_init(&codecAttr);
pthread_attr_setstacksize(&codecAttr, 16384);
#ifdef _MIOSIX
// Set priority of CODEC2 thread to the maximum one, the same of RTX thread.
struct sched_param param;
param.sched_priority = sched_get_priority_max(0);
pthread_attr_setschedparam(&codecAttr, &param);
#endif
pthread_create(&codecThread, &codecAttr, threadFunc, NULL);
}