File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ static void bleLoop()
162
162
}
163
163
164
164
static rtos::EventFlags bleEventFlags;
165
- static rtos::Thread bleLoopThread;
165
+ static rtos::Thread* bleLoopThread = NULL ;
166
166
167
167
168
168
HCICordioTransportClass::HCICordioTransportClass () :
@@ -186,7 +186,10 @@ int HCICordioTransportClass::begin()
186
186
CordioHCIHook::getDriver ().initialize ();
187
187
CordioHCIHook::getDriver ().start_reset_sequence ();
188
188
189
- bleLoopThread.start (bleLoop);
189
+ if (bleLoopThread == NULL ) {
190
+ bleLoopThread = new rtos::Thread ();
191
+ bleLoopThread->start (bleLoop);
192
+ }
190
193
191
194
CordioHCIHook::setDataReceivedHandler (HCICordioTransportClass::onDataReceived);
192
195
@@ -197,7 +200,11 @@ int HCICordioTransportClass::begin()
197
200
198
201
void HCICordioTransportClass::end ()
199
202
{
200
- bleLoopThread.terminate ();
203
+ if (bleLoopThread != NULL ) {
204
+ bleLoopThread->terminate ();
205
+ delete bleLoopThread;
206
+ bleLoopThread = NULL ;
207
+ }
201
208
202
209
CordioHCIHook::getDriver ().terminate ();
203
210
You can’t perform that action at this time.
0 commit comments