mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 22:22:21 -04:00
Fix baseband thread init order bug for all procs. (#1293)
This commit is contained in:
parent
828eb67a52
commit
7bd370b5bc
46 changed files with 226 additions and 174 deletions
|
@ -32,16 +32,25 @@ WORKING_AREA(rssi_thread_wa, 128);
|
|||
|
||||
Thread* RSSIThread::thread = nullptr;
|
||||
|
||||
RSSIThread::RSSIThread(const tprio_t priority) {
|
||||
thread = chThdCreateStatic(rssi_thread_wa, sizeof(rssi_thread_wa),
|
||||
priority, ThreadBase::fn,
|
||||
this);
|
||||
RSSIThread::RSSIThread(bool auto_start, tprio_t priority)
|
||||
: priority_{priority} {
|
||||
if (auto_start) start();
|
||||
}
|
||||
|
||||
RSSIThread::~RSSIThread() {
|
||||
chThdTerminate(thread);
|
||||
chThdWait(thread);
|
||||
thread = nullptr;
|
||||
if (thread) {
|
||||
chThdTerminate(thread);
|
||||
chThdWait(thread);
|
||||
thread = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void RSSIThread::start() {
|
||||
if (!thread) {
|
||||
thread = chThdCreateStatic(
|
||||
rssi_thread_wa, sizeof(rssi_thread_wa),
|
||||
priority_, ThreadBase::fn, this);
|
||||
}
|
||||
}
|
||||
|
||||
void RSSIThread::run() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue