arduino-audio-tools
Loading...
Searching...
No Matches
src
AudioTools
Concurrency
RP2040
MutexRP2040.h
1
#pragma once
2
//#include "AudioLogger.h"
3
#include "AudioTools/Concurrency/Mutex.h"
4
5
namespace
audio_tools
{
6
13
class
NoInterruptHandler
:
public
MutexBase
{
14
public
:
15
void
lock()
override
{
16
noInterrupts();
17
}
18
void
unlock()
override
{
19
interrupts();
20
}
21
};
22
35
class
MutexRP2040
:
public
MutexBase
{
36
public
:
37
MutexRP2040
() {
38
mutex_init(&mtx);
39
}
40
virtual
~MutexRP2040
() =
default
;
41
42
void
lock()
override
{
43
mutex_enter_blocking(&mtx);
44
}
45
void
unlock()
override
{
46
mutex_exit(&mtx);
47
}
48
49
protected
:
50
mutex_t mtx;
51
};
52
55
using
Mutex
=
MutexRP2040
;
56
57
}
// namespace audio_tools
audio_tools::MutexBase
Empty Mutex implementation which does nothing.
Definition
Mutex.h:18
audio_tools::MutexRP2040
Mutex API for non IRQ mutual exclusion between cores. Mutexes are application level locks usually use...
Definition
MutexRP2040.h:35
audio_tools::NoInterruptHandler
Disable, enable interrupts (only on the actual core)
Definition
MutexRP2040.h:13
audio_tools
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition
AudioCodecsBase.h:10
Generated by
1.9.8