File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ class USBMSD: public internal::PluggableUSBModule {
268268
269269 //  Interrupt to thread deferral
270270 events::PolledQueue _queue;
271+  rtos::EventFlags _data_available;
271272 events::Task<void ()> _in_task;
272273 events::Task<void ()> _out_task;
273274 mbed::Callback<void ()> _reset_task;
Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ void USBMSD::process()
185185{
186186 while  (1 ) {
187187 if  (_initialized) {
188+  _data_available.wait_any (0xFF , 10 );
188189 _queue.dispatch ();
189190 // yield();
190191 }
@@ -249,11 +250,13 @@ int USBMSD::disk_status()
249250
250251void  USBMSD::_isr_out ()
251252{
253+  _data_available.set (1 );
252254 _out_task.call ();
253255}
254256
255257void  USBMSD::_isr_in ()
256258{
259+  _data_available.set (1 );
257260 _in_task.call ();
258261}
259262
                         You can’t perform that action at this time. 
           
                  
0 commit comments