File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 22
22
23
23
#include " PlatformMutex.h"
24
24
#include " spi_api.h"
25
+ #include " SingletonPtr.h"
25
26
26
27
#if DEVICE_SPI_ASYNCH
27
28
#include " CThunk.h"
@@ -247,7 +248,7 @@ class SPI {
247
248
248
249
void aquire (void );
249
250
static SPI *_owner;
250
- PlatformMutex _mutex;
251
+ static SingletonPtr< PlatformMutex> _mutex;
251
252
int _bits;
252
253
int _mode;
253
254
int _hz;
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ void SPI::frequency(int hz) {
57
57
}
58
58
59
59
SPI* SPI::_owner = NULL ;
60
+ SingletonPtr<PlatformMutex> SPI::_mutex;
60
61
61
62
// ignore the fact there are multiple physical spis, and always update if it wasnt us last
62
63
void SPI::aquire () {
@@ -78,11 +79,11 @@ int SPI::write(int value) {
78
79
}
79
80
80
81
void SPI::lock () {
81
- _mutex. lock ();
82
+ _mutex-> lock ();
82
83
}
83
84
84
85
void SPI::unlock () {
85
- _mutex. unlock ();
86
+ _mutex-> unlock ();
86
87
}
87
88
88
89
#if DEVICE_SPI_ASYNCH
You can’t perform that action at this time.
0 commit comments