Skip to content

Commit c73d36b

Browse files
author
Hein Tibosch
committed
Make xSequenceLessThan and xSequenceGreaterThan public functions
1 parent 213ab43 commit c73d36b

File tree

2 files changed

+51
-40
lines changed

2 files changed

+51
-40
lines changed

FreeRTOS_TCP_WIN.c

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,6 @@
269269
#endif /* ipconfigUSE_TCP_WIN */
270270
/*-----------------------------------------------------------*/
271271

272-
#if ( ipconfigUSE_TCP_WIN == 1 )
273-
static portINLINE BaseType_t xSequenceLessThan( uint32_t a,
274-
uint32_t b );
275-
276272
/**
277273
* @brief Check if a < b.
278274
*
@@ -281,30 +277,25 @@
281277
*
282278
* @return pdTRUE when "( b - ( a + 1 ) ) < 0x80000000", else pdFALSE.
283279
*/
284-
static portINLINE BaseType_t xSequenceLessThan( uint32_t a,
285-
uint32_t b )
286-
{
287-
BaseType_t xResult;
288-
289-
/* Test if a < b */
290-
if( ( ( b - ( a + 1UL ) ) & 0x80000000UL ) == 0UL )
291-
{
292-
xResult = pdTRUE;
293-
}
294-
else
295-
{
296-
xResult = pdFALSE;
297-
}
280+
BaseType_t xSequenceLessThan( uint32_t a,
281+
uint32_t b )
282+
{
283+
BaseType_t xResult;
298284

299-
return xResult;
285+
/* Test if a < b */
286+
if( ( ( b - ( a + 1UL ) ) & 0x80000000UL ) == 0UL )
287+
{
288+
xResult = pdTRUE;
289+
}
290+
else
291+
{
292+
xResult = pdFALSE;
300293
}
301294

302-
#endif /* ipconfigUSE_TCP_WIN */
303-
/*-----------------------------------------------------------*/
295+
return xResult;
296+
}
304297

305-
#if ( ipconfigUSE_TCP_WIN == 1 )
306-
static portINLINE BaseType_t xSequenceGreaterThan( uint32_t a,
307-
uint32_t b );
298+
/*-----------------------------------------------------------*/
308299

309300
/**
310301
* @brief Check if a > b.
@@ -314,25 +305,24 @@
314305
*
315306
* @return pdTRUE when "( a - b ) < 0x80000000", else pdFALSE.
316307
*/
317-
static portINLINE BaseType_t xSequenceGreaterThan( uint32_t a,
318-
uint32_t b )
319-
{
320-
BaseType_t xResult;
321-
322-
/* Test if a > b */
323-
if( ( ( a - ( b + 1UL ) ) & 0x80000000UL ) == 0UL )
324-
{
325-
xResult = pdTRUE;
326-
}
327-
else
328-
{
329-
xResult = pdFALSE;
330-
}
308+
BaseType_t xSequenceGreaterThan( uint32_t a,
309+
uint32_t b )
310+
{
311+
BaseType_t xResult;
331312

332-
return xResult;
313+
/* Test if a > b */
314+
if( ( ( a - ( b + 1UL ) ) & 0x80000000UL ) == 0UL )
315+
{
316+
xResult = pdTRUE;
317+
}
318+
else
319+
{
320+
xResult = pdFALSE;
333321
}
334322

335-
#endif /* ipconfigUSE_TCP_WIN */
323+
return xResult;
324+
}
325+
336326

337327
/*-----------------------------------------------------------*/
338328
static portINLINE BaseType_t xSequenceGreaterThanOrEqual( uint32_t a,

include/FreeRTOS_TCP_WIN.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,27 @@
229229
uint32_t ulFirst,
230230
uint32_t ulLast );
231231

232+
/**
233+
* @brief Check if a > b.
234+
*
235+
* @param[in] a: The value on the left-hand side.
236+
* @param[in] b: The value on the right-hand side.
237+
*
238+
* @return pdTRUE or pdFALSE.
239+
*/
240+
BaseType_t xSequenceGreaterThan( uint32_t a,
241+
uint32_t b );
242+
243+
/**
244+
* @brief Check if a < b.
245+
*
246+
* @param[in] a: The value on the left-hand side.
247+
* @param[in] b: The value on the right-hand side.
248+
*
249+
* @return pdTRUE or pdFALSE.
250+
*/
251+
BaseType_t xSequenceLessThan( uint32_t a,
252+
uint32_t b );
232253

233254
#ifdef __cplusplus
234255
} /* extern "C" */

0 commit comments

Comments
 (0)