- /* A margin may be required here if there are other high priority\r
- tasks prevent the task that reads from the message buffer running\r
- immediately. */\r
- xErrorDetected = pdTRUE;\r
+ /* Trigger level was less than the block time so we expect to\r
+ have received the trigger level number of bytes - could be more\r
+ though depending on other activity between the task being\r
+ unblocked and the task reading the number of bytes received. */\r
+ if( ( xBytesReceived - xTriggerLevel ) > xAllowableMargin )\r
+ {\r
+ xErrorDetected = pdTRUE;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ /* The trigger level equaled the block time, so expect to\r
+ receive no greater than the block time, but one or two less is\r
+ ok due to variations in how far through the time slice the\r
+ functions get executed. */\r
+ if( ( xBytesReceived - xReadBlockTime ) > xAllowableMargin )\r
+ {\r
+ xErrorDetected = pdTRUE;\r
+ }\r