File tree 2 files changed +4
-0
lines changed
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 {
268
268
269
269
// Interrupt to thread deferral
270
270
events::PolledQueue _queue;
271
+ rtos::EventFlags _data_available;
271
272
events::Task<void ()> _in_task;
272
273
events::Task<void ()> _out_task;
273
274
mbed::Callback<void ()> _reset_task;
Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ void USBMSD::process()
185
185
{
186
186
while (1 ) {
187
187
if (_initialized) {
188
+ _data_available.wait_any (0xFF , 10 );
188
189
_queue.dispatch ();
189
190
// yield();
190
191
}
@@ -249,11 +250,13 @@ int USBMSD::disk_status()
249
250
250
251
void USBMSD::_isr_out ()
251
252
{
253
+ _data_available.set (1 );
252
254
_out_task.call ();
253
255
}
254
256
255
257
void USBMSD::_isr_in ()
256
258
{
259
+ _data_available.set (1 );
257
260
_in_task.call ();
258
261
}
259
262
You can’t perform that action at this time.
0 commit comments