@@ -307,12 +307,14 @@ void vCoRoutineSchedule( void );
307
307
* \defgroup crDELAY crDELAY
308
308
* \ingroup Tasks
309
309
*/
310
- #define crDELAY ( xHandle , xTicksToDelay ) \
311
- if( ( xTicksToDelay ) > 0 ) \
312
- { \
313
- vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
314
- } \
315
- crSET_STATE0( ( xHandle ) );
310
+ #define crDELAY ( xHandle , xTicksToDelay ) \
311
+ do { \
312
+ if( ( xTicksToDelay ) > 0 ) \
313
+ { \
314
+ vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
315
+ } \
316
+ crSET_STATE0( ( xHandle ) ); \
317
+ } while( 0 )
316
318
317
319
/**
318
320
* @code{c}
@@ -400,7 +402,7 @@ void vCoRoutineSchedule( void );
400
402
* \ingroup Tasks
401
403
*/
402
404
#define crQUEUE_SEND ( xHandle , pxQueue , pvItemToQueue , xTicksToWait , pxResult ) \
403
- { \
405
+ do { \
404
406
*( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
405
407
if( *( pxResult ) == errQUEUE_BLOCKED ) \
406
408
{ \
@@ -412,7 +414,7 @@ void vCoRoutineSchedule( void );
412
414
crSET_STATE1( ( xHandle ) ); \
413
415
*pxResult = pdPASS; \
414
416
} \
415
- }
417
+ } while( 0 )
416
418
417
419
/**
418
420
* croutine. h
@@ -494,7 +496,7 @@ void vCoRoutineSchedule( void );
494
496
* \ingroup Tasks
495
497
*/
496
498
#define crQUEUE_RECEIVE ( xHandle , pxQueue , pvBuffer , xTicksToWait , pxResult ) \
497
- { \
499
+ do { \
498
500
*( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
499
501
if( *( pxResult ) == errQUEUE_BLOCKED ) \
500
502
{ \
@@ -506,7 +508,7 @@ void vCoRoutineSchedule( void );
506
508
crSET_STATE1( ( xHandle ) ); \
507
509
*( pxResult ) = pdPASS; \
508
510
} \
509
- }
511
+ } while( 0 )
510
512
511
513
/**
512
514
* croutine. h
0 commit comments