mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Update in preparation for the V4.3.1 release.
This commit is contained in:
parent
8235f7a15f
commit
42b2cbf237
|
@ -32,7 +32,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -44,15 +44,16 @@ static const char * const g_pcHex = "0123456789abcdef";
|
|||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! A simple sprintf function supporting \%c, \%d, \%s, \%u, \%x, and \%X.
|
||||
//! A simple vsnprintf function supporting \%c, \%d, \%s, \%u, \%x, and \%X.
|
||||
//!
|
||||
//! \param pcBuf is the buffer where the converted string is stored.
|
||||
//! \param pcBuf points to the buffer where the converted string is stored.
|
||||
//! \param ulSize is the size of the buffer.
|
||||
//! \param pcString is the format string.
|
||||
//! \param ... are the optional arguments, which depend on the contents of the
|
||||
//! format string.
|
||||
//! \param vaArgP is the list of optional arguments, which depend on the
|
||||
//! contents of the format string.
|
||||
//!
|
||||
//! This function is very similar to the C library <tt>sprintf()</tt> function.
|
||||
//! Only the following formatting characters are supported:
|
||||
//! This function is very similar to the C library <tt>vsnprintf()</tt>
|
||||
//! function. Only the following formatting characters are supported:
|
||||
//!
|
||||
//! - \%c to print a character
|
||||
//! - \%d to print a decimal value
|
||||
|
@ -75,18 +76,29 @@ static const char * const g_pcHex = "0123456789abcdef";
|
|||
//! the format string. For example, if an integer was passed where a string
|
||||
//! was expected, an error of some kind will most likely occur.
|
||||
//!
|
||||
//! The caller must ensure that the buffer pcBuf is large enough to hold the
|
||||
//! entire converted string, including the null termination character.
|
||||
//! The \b ulSize parameter limits the number of characters that will be
|
||||
//! stored in the buffer pointed to by \b pcBuf to prevent the possibility
|
||||
//! of a buffer overflow. The buffer size should be large enough to hold
|
||||
//! the expected converted output string, including the null termination
|
||||
//! character.
|
||||
//!
|
||||
//! \return None.
|
||||
//! The function will return the number of characters that would be
|
||||
//! converted as if there were no limit on the buffer size. Therefore
|
||||
//! it is possible for the function to return a count that is greater than
|
||||
//! the specified buffer size. If this happens, it means that the output
|
||||
//! was truncated.
|
||||
//!
|
||||
//! \return the number of characters that were to be stored, not including
|
||||
//! the NULL termination character, regardless of space in the buffer.
|
||||
//
|
||||
//*****************************************************************************
|
||||
int
|
||||
uvsnprintf(char *pcBuf, unsigned long ulSize, const char *pcString,
|
||||
va_list vaArgP)
|
||||
{
|
||||
unsigned long ulIdx, ulValue, ulPos, ulCount, ulBase;
|
||||
char *pcStr, cFill, *pcOriginalBuf = pcBuf;
|
||||
unsigned long ulIdx, ulValue, ulCount, ulBase;
|
||||
char *pcStr, cFill;
|
||||
int iConvertCount = 0;
|
||||
|
||||
//
|
||||
// Check the arguments.
|
||||
|
@ -104,10 +116,14 @@ uvsnprintf(char *pcBuf, unsigned long ulSize, const char *pcString,
|
|||
}
|
||||
|
||||
//
|
||||
// Loop while there are more characters in the string, and
|
||||
// there is more room in the destination buffer.
|
||||
// Initialize the count of characters converted.
|
||||
//
|
||||
while(*pcString && ulSize)
|
||||
iConvertCount = 0;
|
||||
|
||||
//
|
||||
// Loop while there are more characters in the format string.
|
||||
//
|
||||
while(*pcString)
|
||||
{
|
||||
//
|
||||
// Find the first non-% character, or the end of the string.
|
||||
|
@ -118,32 +134,32 @@ uvsnprintf(char *pcBuf, unsigned long ulSize, const char *pcString,
|
|||
}
|
||||
|
||||
//
|
||||
// Limit the number of characters that can be copied to the
|
||||
// space remaining in the buffer.
|
||||
// Write this portion of the string to the output buffer. If
|
||||
// there are more characters to write than there is space in the
|
||||
// buffer, then only write as much as will fit in the buffer.
|
||||
//
|
||||
if(ulIdx > ulSize)
|
||||
{
|
||||
ulIdx = ulSize;
|
||||
strncpy(pcBuf, pcString, ulSize);
|
||||
pcBuf += ulSize;
|
||||
ulSize = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Write this portion of the string and update the buffer pointer.
|
||||
//
|
||||
strncpy(pcBuf, pcString, ulIdx);
|
||||
pcBuf += ulIdx;
|
||||
|
||||
//
|
||||
// Update the size limit, and check to see if the buffer
|
||||
// limit is reached.
|
||||
//
|
||||
ulSize -= ulIdx;
|
||||
if(ulSize == 0)
|
||||
else
|
||||
{
|
||||
break;
|
||||
strncpy(pcBuf, pcString, ulIdx);
|
||||
pcBuf += ulIdx;
|
||||
ulSize -= ulIdx;
|
||||
}
|
||||
|
||||
//
|
||||
// Skip the portion of the string that was written.
|
||||
// Update the conversion count. This will be the number of
|
||||
// characters that should have been written, even if there was
|
||||
// not room in the buffer.
|
||||
//
|
||||
iConvertCount += ulIdx;
|
||||
|
||||
//
|
||||
// Skip the portion of the format string that was written.
|
||||
//
|
||||
pcString += ulIdx;
|
||||
|
||||
|
@ -222,14 +238,19 @@ again:
|
|||
ulValue = va_arg(vaArgP, unsigned long);
|
||||
|
||||
//
|
||||
// Print out the character.
|
||||
// Copy the character to the output buffer, if
|
||||
// there is room. Update the buffer size remaining.
|
||||
//
|
||||
*pcBuf++ = (char)ulValue;
|
||||
if(ulSize != 0)
|
||||
{
|
||||
*pcBuf++ = (char)ulValue;
|
||||
ulSize--;
|
||||
}
|
||||
|
||||
//
|
||||
// Decrement the buffer limit.
|
||||
// Update the conversion count.
|
||||
//
|
||||
ulSize--;
|
||||
iConvertCount++;
|
||||
|
||||
//
|
||||
// This command has been handled.
|
||||
|
@ -247,30 +268,24 @@ again:
|
|||
//
|
||||
ulValue = va_arg(vaArgP, unsigned long);
|
||||
|
||||
//
|
||||
// Reset the buffer position.
|
||||
//
|
||||
ulPos = 0;
|
||||
|
||||
//
|
||||
// If the value is negative, make it positive and stick a
|
||||
// minus sign in the beginning of the buffer.
|
||||
//
|
||||
if((long)ulValue < 0)
|
||||
{
|
||||
*pcBuf++ = '-';
|
||||
ulPos++;
|
||||
ulValue = -(long)ulValue;
|
||||
|
||||
//
|
||||
// Decrement the buffer size limit and check
|
||||
// if the limit is reached.
|
||||
//
|
||||
ulSize--;
|
||||
if(ulSize == 0)
|
||||
if(ulSize != 0)
|
||||
{
|
||||
break;
|
||||
*pcBuf++ = '-';
|
||||
ulSize--;
|
||||
}
|
||||
|
||||
//
|
||||
// Update the conversion count.
|
||||
//
|
||||
iConvertCount++;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -302,24 +317,29 @@ again:
|
|||
}
|
||||
|
||||
//
|
||||
// Limit the number of characters that can be copied to the
|
||||
// space remaining in the buffer.
|
||||
// Copy the string to the output buffer. Only copy
|
||||
// as much as will fit in the buffer. Update the
|
||||
// output buffer pointer and the space remaining.
|
||||
//
|
||||
if(ulIdx > ulSize)
|
||||
{
|
||||
ulIdx = ulSize;
|
||||
strncpy(pcBuf, pcStr, ulSize);
|
||||
pcBuf += ulSize;
|
||||
ulSize = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(pcBuf, pcStr, ulIdx);
|
||||
pcBuf += ulIdx;
|
||||
ulSize -= ulIdx;
|
||||
}
|
||||
|
||||
//
|
||||
// Write the string and update the buffer pointer.
|
||||
// Update the conversion count. This will be the number of
|
||||
// characters that should have been written, even if there
|
||||
// was not room in the buffer.
|
||||
//
|
||||
strncpy(pcBuf, pcStr, ulIdx);
|
||||
pcBuf += ulIdx;
|
||||
|
||||
//
|
||||
// Decrement the buffer size limit.
|
||||
//
|
||||
ulSize -= ulIdx;
|
||||
iConvertCount += ulIdx;
|
||||
|
||||
//
|
||||
//
|
||||
|
@ -338,11 +358,6 @@ again:
|
|||
//
|
||||
ulValue = va_arg(vaArgP, unsigned long);
|
||||
|
||||
//
|
||||
// Reset the buffer position.
|
||||
//
|
||||
ulPos = 0;
|
||||
|
||||
//
|
||||
// Set the base to 10.
|
||||
//
|
||||
|
@ -367,11 +382,6 @@ again:
|
|||
//
|
||||
ulValue = va_arg(vaArgP, unsigned long);
|
||||
|
||||
//
|
||||
// Reset the buffer position.
|
||||
//
|
||||
ulPos = 0;
|
||||
|
||||
//
|
||||
// Set the base to 16.
|
||||
//
|
||||
|
@ -397,18 +407,20 @@ convert:
|
|||
{
|
||||
for(ulCount--; ulCount; ulCount--)
|
||||
{
|
||||
*pcBuf++ = cFill;
|
||||
ulPos++;
|
||||
//
|
||||
// Copy the character to the output buffer if
|
||||
// there is room.
|
||||
//
|
||||
if(ulSize != 0)
|
||||
{
|
||||
*pcBuf++ = cFill;
|
||||
ulSize--;
|
||||
}
|
||||
|
||||
//
|
||||
// Decrement buffer size and check to see if
|
||||
// buffer limit is reached.
|
||||
// Update the conversion count.
|
||||
//
|
||||
ulSize--;
|
||||
if(ulSize == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
iConvertCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -417,18 +429,20 @@ convert:
|
|||
//
|
||||
for(; ulIdx; ulIdx /= ulBase)
|
||||
{
|
||||
*pcBuf++ = g_pcHex[(ulValue / ulIdx) % ulBase];
|
||||
ulPos++;
|
||||
//
|
||||
// Copy the character to the output buffer if
|
||||
// there is room.
|
||||
//
|
||||
if(ulSize != 0)
|
||||
{
|
||||
*pcBuf++ = g_pcHex[(ulValue / ulIdx) % ulBase];
|
||||
ulSize--;
|
||||
}
|
||||
|
||||
//
|
||||
// Decrement buffer size and check to see if
|
||||
// buffer limit is reached.
|
||||
// Update the conversion count.
|
||||
//
|
||||
ulSize--;
|
||||
if(ulSize == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
iConvertCount++;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -445,8 +459,16 @@ convert:
|
|||
//
|
||||
// Simply write a single %.
|
||||
//
|
||||
*pcBuf++ = pcString[-1];
|
||||
ulSize--;
|
||||
if(ulSize != 0)
|
||||
{
|
||||
*pcBuf++ = pcString[-1];
|
||||
ulSize--;
|
||||
}
|
||||
|
||||
//
|
||||
// Update the conversion count.
|
||||
//
|
||||
iConvertCount++;
|
||||
|
||||
//
|
||||
// This command has been handled.
|
||||
|
@ -462,12 +484,23 @@ convert:
|
|||
//
|
||||
// Indicate an error.
|
||||
//
|
||||
if(ulSize > 5)
|
||||
if(ulSize >= 5)
|
||||
{
|
||||
strncpy(pcBuf, "ERROR", 5);
|
||||
pcBuf += 5;
|
||||
ulSize -= 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(pcBuf, "ERROR", ulSize);
|
||||
pcBuf += ulSize;
|
||||
ulSize = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Update the conversion count.
|
||||
//
|
||||
iConvertCount += 5;
|
||||
|
||||
//
|
||||
// This command has been handled.
|
||||
|
@ -482,7 +515,7 @@ convert:
|
|||
// Null terminate the string in the buffer.
|
||||
//
|
||||
*pcBuf = 0;
|
||||
return ( int ) pcBuf - ( int ) pcOriginalBuf;
|
||||
return(iConvertCount);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
@ -521,13 +554,15 @@ convert:
|
|||
//! The caller must ensure that the buffer pcBuf is large enough to hold the
|
||||
//! entire converted string, including the null termination character.
|
||||
//!
|
||||
//! \return None.
|
||||
//! \return The count of characters that were written to the output buffer,
|
||||
//! not including the NULL termination character.
|
||||
//
|
||||
//*****************************************************************************
|
||||
void
|
||||
int
|
||||
usprintf(char *pcBuf, const char *pcString, ...)
|
||||
{
|
||||
va_list vaArgP;
|
||||
int iRet;
|
||||
|
||||
//
|
||||
// Start the varargs processing.
|
||||
|
@ -538,12 +573,17 @@ usprintf(char *pcBuf, const char *pcString, ...)
|
|||
// Call vsnprintf to perform the conversion. Use a
|
||||
// large number for the buffer size.
|
||||
//
|
||||
uvsnprintf(pcBuf, 0xffff, pcString, vaArgP);
|
||||
iRet = uvsnprintf(pcBuf, 0xffff, pcString, vaArgP);
|
||||
|
||||
//
|
||||
// End the varargs processing.
|
||||
//
|
||||
va_end(vaArgP);
|
||||
|
||||
//
|
||||
// Return the conversion count.
|
||||
//
|
||||
return(iRet);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
@ -584,13 +624,20 @@ usprintf(char *pcBuf, const char *pcString, ...)
|
|||
//! buffer \b pcBuf. One space is reserved in the buffer for the null
|
||||
//! termination character.
|
||||
//!
|
||||
//! \return None.
|
||||
//! The function will return the number of characters that would be
|
||||
//! converted as if there were no limit on the buffer size. Therefore
|
||||
//! it is possible for the function to return a count that is greater than
|
||||
//! the specified buffer size. If this happens, it means that the output
|
||||
//! was truncated.
|
||||
//!
|
||||
//! \return the number of characters that were to be stored, not including
|
||||
//! the NULL termination character, regardless of space in the buffer.
|
||||
//
|
||||
//*****************************************************************************
|
||||
int
|
||||
usnprintf(char *pcBuf, unsigned long ulSize, const char *pcString, ...)
|
||||
{
|
||||
int iReturn;
|
||||
int iRet;
|
||||
|
||||
va_list vaArgP;
|
||||
|
||||
|
@ -602,14 +649,17 @@ int iReturn;
|
|||
//
|
||||
// Call vsnprintf to perform the conversion.
|
||||
//
|
||||
iReturn = uvsnprintf(pcBuf, ulSize, pcString, vaArgP);
|
||||
iRet = uvsnprintf(pcBuf, ulSize, pcString, vaArgP);
|
||||
|
||||
//
|
||||
// End the varargs processing.
|
||||
//
|
||||
va_end(vaArgP);
|
||||
|
||||
return iReturn;
|
||||
//
|
||||
// Return the conversion count.
|
||||
//
|
||||
return(iRet);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
|
|
@ -3,24 +3,24 @@
|
|||
// uartstdlib.h - Prototypes for simple standard library functions.
|
||||
//
|
||||
// Copyright (c) 2007 Luminary Micro, Inc. All rights reserved.
|
||||
//
|
||||
//
|
||||
// Software License Agreement
|
||||
//
|
||||
//
|
||||
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
||||
// exclusively on LMI's microcontroller products.
|
||||
//
|
||||
//
|
||||
// The software is owned by LMI and/or its suppliers, and is protected under
|
||||
// applicable copyright laws. All rights are reserved. Any use in violation
|
||||
// of the foregoing restrictions may subject the user to criminal sanctions
|
||||
// under applicable laws, as well as to civil liability for the breach of the
|
||||
// terms and conditions of this license.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
||||
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
||||
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
||||
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
||||
//
|
||||
//
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
|
@ -37,7 +37,9 @@ extern "C"
|
|||
// Prototypes for the APIs.
|
||||
//
|
||||
//*****************************************************************************
|
||||
extern void usprintf(char *, const char *pcString, ...);
|
||||
extern int usprintf(char *, const char *pcString, ...);
|
||||
extern int usnprintf(char *pcBuf, unsigned long ulSize,
|
||||
const char *pcString, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
@ -19,13 +19,13 @@
|
|||
|
||||
A special exception to the GPL can be applied should you wish to distribute
|
||||
a combined work that includes FreeRTOS.org, without being obliged to provide
|
||||
the source code for any proprietary components. See the licensing section
|
||||
the source code for any proprietary components. See the licensing section
|
||||
of http://www.FreeRTOS.org for full details of how and when the exception
|
||||
can be applied.
|
||||
|
||||
***************************************************************************
|
||||
See http://www.FreeRTOS.org for documentation, latest information, license
|
||||
and contact details. Please ensure to read the configuration and relevant
|
||||
See http://www.FreeRTOS.org for documentation, latest information, license
|
||||
and contact details. Please ensure to read the configuration and relevant
|
||||
port sections of the online documentation.
|
||||
|
||||
Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
/*
|
||||
* This file contains some test scenarios that ensure tasks do not exit queue
|
||||
* send or receive functions prematurely. A description of the tests is
|
||||
* send or receive functions prematurely. A description of the tests is
|
||||
* included within the code.
|
||||
*/
|
||||
|
||||
|
@ -44,6 +44,9 @@
|
|||
#include "task.h"
|
||||
#include "queue.h"
|
||||
|
||||
/* Demo includes. */
|
||||
#include "blocktim.h"
|
||||
|
||||
/* Task priorities. */
|
||||
#define bktPRIMARY_PRIORITY ( 3 )
|
||||
#define bktSECONDARY_PRIORITY ( 2 )
|
||||
|
@ -68,7 +71,7 @@ static xTaskHandle xSecondary;
|
|||
static portBASE_TYPE xPrimaryCycles = 0, xSecondaryCycles = 0;
|
||||
static portBASE_TYPE xErrorOccurred = pdFALSE;
|
||||
|
||||
/* Provides a simple mechanism for the primary task to know when the
|
||||
/* Provides a simple mechanism for the primary task to know when the
|
||||
secondary task has executed. */
|
||||
static volatile unsigned portBASE_TYPE xRunIndicator;
|
||||
|
||||
|
@ -125,7 +128,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
}
|
||||
portEXIT_CRITICAL();
|
||||
|
||||
if( xBlockedTime < xTimeToBlock )
|
||||
if( xBlockedTime < xTimeToBlock )
|
||||
{
|
||||
/* Should not have blocked for less than we requested. */
|
||||
xErrorOccurred = pdTRUE;
|
||||
|
@ -134,7 +137,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
if( xBlockedTime > ( xTimeToBlock + bktALLOWABLE_MARGIN ) )
|
||||
{
|
||||
/* Should not have blocked for longer than we requested,
|
||||
although we would not necessarily run as soon as we were
|
||||
although we would not necessarily run as soon as we were
|
||||
unblocked so a margin is allowed. */
|
||||
xErrorOccurred = pdTRUE;
|
||||
}
|
||||
|
@ -176,7 +179,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
}
|
||||
portEXIT_CRITICAL();
|
||||
|
||||
if( xBlockedTime < xTimeToBlock )
|
||||
if( xBlockedTime < xTimeToBlock )
|
||||
{
|
||||
/* Should not have blocked for less than we requested. */
|
||||
xErrorOccurred = pdTRUE;
|
||||
|
@ -185,7 +188,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
if( xBlockedTime > ( xTimeToBlock + bktALLOWABLE_MARGIN ) )
|
||||
{
|
||||
/* Should not have blocked for longer than we requested,
|
||||
although we would not necessarily run as soon as we were
|
||||
although we would not necessarily run as soon as we were
|
||||
unblocked so a margin is allowed. */
|
||||
xErrorOccurred = pdTRUE;
|
||||
}
|
||||
|
@ -227,7 +230,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
}
|
||||
|
||||
/* Now fill the queue again before the other task gets a chance to
|
||||
execute. If the other task had executed we would find the queue
|
||||
execute. If the other task had executed we would find the queue
|
||||
full ourselves, and the other task have set xRunIndicator. */
|
||||
if( xQueueSend( xTestQueue, &xItem, bktDONT_BLOCK ) != pdPASS )
|
||||
{
|
||||
|
@ -270,7 +273,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
/*********************************************************************
|
||||
Test 4
|
||||
|
||||
As per test 3 - but with the send and receive the other way around.
|
||||
As per test 3 - but with the send and receive the other way around.
|
||||
The other task blocks attempting to read from the queue.
|
||||
|
||||
Empty the queue. We should find that it is full. */
|
||||
|
@ -282,7 +285,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
}
|
||||
}
|
||||
|
||||
/* Wake the other task so it blocks attempting to read from the
|
||||
/* Wake the other task so it blocks attempting to read from the
|
||||
already empty queue. */
|
||||
vTaskResume( xSecondary );
|
||||
|
||||
|
@ -296,7 +299,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
|
||||
for( xItem = 0; xItem < bktQUEUE_LENGTH; xItem++ )
|
||||
{
|
||||
/* Now when we place an item on the queue the other task should
|
||||
/* Now when we place an item on the queue the other task should
|
||||
wake but not execute as this task has higher priority. */
|
||||
if( xQueueSend( xTestQueue, &xItem, bktDONT_BLOCK ) != pdPASS )
|
||||
{
|
||||
|
@ -304,7 +307,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
}
|
||||
|
||||
/* Now empty the queue again before the other task gets a chance to
|
||||
execute. If the other task had executed we would find the queue
|
||||
execute. If the other task had executed we would find the queue
|
||||
empty ourselves, and the other task would be suspended. */
|
||||
if( xQueueReceive( xTestQueue, &xData, bktDONT_BLOCK ) != pdPASS )
|
||||
{
|
||||
|
@ -321,7 +324,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
on the queue again. */
|
||||
vTaskPrioritySet( xSecondary, bktPRIMARY_PRIORITY + 2 );
|
||||
|
||||
/* The other task should now have re-blocked without exiting the
|
||||
/* The other task should now have re-blocked without exiting the
|
||||
queue function. */
|
||||
if( xRunIndicator == bktRUN_INDICATOR )
|
||||
{
|
||||
|
@ -388,7 +391,7 @@ portBASE_TYPE xData;
|
|||
xErrorOccurred = pdTRUE;
|
||||
}
|
||||
|
||||
/* We should of not blocked for much longer than bktALLOWABLE_MARGIN
|
||||
/* We should of not blocked for much longer than bktALLOWABLE_MARGIN
|
||||
either. A margin is permitted as we would not necessarily run as
|
||||
soon as we unblocked. */
|
||||
if( xBlockedTime > ( bktTIME_TO_BLOCK + bktALLOWABLE_MARGIN ) )
|
||||
|
@ -426,7 +429,7 @@ portBASE_TYPE xData;
|
|||
xErrorOccurred = pdTRUE;
|
||||
}
|
||||
|
||||
/* We should of not blocked for much longer than bktALLOWABLE_MARGIN
|
||||
/* We should of not blocked for much longer than bktALLOWABLE_MARGIN
|
||||
either. A margin is permitted as we would not necessarily run as soon
|
||||
as we unblocked. */
|
||||
if( xBlockedTime > ( bktTIME_TO_BLOCK + bktALLOWABLE_MARGIN ) )
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS.org V4.3.0 - Copyright (C) 2003-2007 Richard Barry.
|
||||
FreeRTOS.org V4.3.1 - Copyright (C) 2003-2007 Richard Barry.
|
||||
|
||||
This file is part of the FreeRTOS.org distribution.
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue