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 2222
2323#include " PlatformMutex.h"
2424#include " spi_api.h"
25+ #include " SingletonPtr.h"
2526
2627#if DEVICE_SPI_ASYNCH
2728#include " CThunk.h"
@@ -247,7 +248,7 @@ class SPI {
247248
248249 void aquire (void );
249250 static SPI *_owner;
250- PlatformMutex _mutex;
251+ static SingletonPtr< PlatformMutex> _mutex;
251252 int _bits;
252253 int _mode;
253254 int _hz;
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ void SPI::frequency(int hz) {
5757}
5858
5959SPI* SPI::_owner = NULL ;
60+ SingletonPtr<PlatformMutex> SPI::_mutex;
6061
6162// ignore the fact there are multiple physical spis, and always update if it wasnt us last
6263void SPI::aquire () {
@@ -78,11 +79,11 @@ int SPI::write(int value) {
7879}
7980
8081void SPI::lock () {
81- _mutex. lock ();
82+ _mutex-> lock ();
8283}
8384
8485void SPI::unlock () {
85- _mutex. unlock ();
86+ _mutex-> unlock ();
8687}
8788
8889#if DEVICE_SPI_ASYNCH
You can’t perform that action at this time.
0 commit comments