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 21
21
#if DEVICE_SPI
22
22
23
23
#include " spi_api.h"
24
+ #include " SingletonPtr.h"
24
25
25
26
#if DEVICE_SPI_ASYNCH
26
27
#include " CThunk.h"
@@ -246,7 +247,7 @@ class SPI {
246
247
247
248
void aquire (void );
248
249
static SPI *_owner;
249
- PlatformMutex _mutex;
250
+ static SingletonPtr< PlatformMutex> _mutex;
250
251
int _bits;
251
252
int _mode;
252
253
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