mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Run uncrustify with github workflows (#369)
* uncrustify with github workflows * Fix find expression * Add uncrustify configuration file * Uncrustify some files * uncrustify some more files * uncrustify more files * Fix whitespace at end of lines Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
This commit is contained in:
parent
85a23127cc
commit
ce81bcb33f
160
.github/uncrustify.cfg
vendored
Normal file
160
.github/uncrustify.cfg
vendored
Normal file
|
@ -0,0 +1,160 @@
|
|||
# Uncrustify-0.67
|
||||
input_tab_size = 4 # unsigned number
|
||||
output_tab_size = 4 # unsigned number
|
||||
sp_arith = force # ignore/add/remove/force
|
||||
sp_assign = force # ignore/add/remove/force
|
||||
sp_assign_default = force # ignore/add/remove/force
|
||||
sp_before_assign = force # ignore/add/remove/force
|
||||
sp_after_assign = force # ignore/add/remove/force
|
||||
sp_enum_assign = force # ignore/add/remove/force
|
||||
sp_enum_before_assign = force # ignore/add/remove/force
|
||||
sp_enum_after_assign = force # ignore/add/remove/force
|
||||
sp_pp_stringify = add # ignore/add/remove/force
|
||||
sp_bool = force # ignore/add/remove/force
|
||||
sp_compare = force # ignore/add/remove/force
|
||||
sp_inside_paren = force # ignore/add/remove/force
|
||||
sp_paren_paren = force # ignore/add/remove/force
|
||||
sp_paren_brace = force # ignore/add/remove/force
|
||||
sp_before_ptr_star = force # ignore/add/remove/force
|
||||
sp_before_unnamed_ptr_star = force # ignore/add/remove/force
|
||||
sp_between_ptr_star = remove # ignore/add/remove/force
|
||||
sp_after_ptr_star = force # ignore/add/remove/force
|
||||
sp_before_byref = force # ignore/add/remove/force
|
||||
sp_after_byref = remove # ignore/add/remove/force
|
||||
sp_after_byref_func = remove # ignore/add/remove/force
|
||||
sp_before_angle = remove # ignore/add/remove/force
|
||||
sp_inside_angle = remove # ignore/add/remove/force
|
||||
sp_after_angle = force # ignore/add/remove/force
|
||||
sp_before_sparen = remove # ignore/add/remove/force
|
||||
sp_inside_sparen = force # ignore/add/remove/force
|
||||
sp_after_sparen = force # ignore/add/remove/force
|
||||
sp_sparen_brace = force # ignore/add/remove/force
|
||||
sp_before_semi_for = remove # ignore/add/remove/force
|
||||
sp_before_semi_for_empty = add # ignore/add/remove/force
|
||||
sp_after_semi_for_empty = force # ignore/add/remove/force
|
||||
sp_before_square = remove # ignore/add/remove/force
|
||||
sp_before_squares = remove # ignore/add/remove/force
|
||||
sp_inside_square = force # ignore/add/remove/force
|
||||
sp_after_comma = force # ignore/add/remove/force
|
||||
sp_after_cast = force # ignore/add/remove/force
|
||||
sp_inside_paren_cast = force # ignore/add/remove/force
|
||||
sp_sizeof_paren = remove # ignore/add/remove/force
|
||||
sp_inside_braces_enum = force # ignore/add/remove/force
|
||||
sp_inside_braces_struct = force # ignore/add/remove/force
|
||||
sp_inside_braces = force # ignore/add/remove/force
|
||||
sp_inside_braces_empty = remove # ignore/add/remove/force
|
||||
sp_type_func = force # ignore/add/remove/force
|
||||
sp_func_proto_paren = remove # ignore/add/remove/force
|
||||
sp_func_def_paren = remove # ignore/add/remove/force
|
||||
sp_inside_fparens = remove # ignore/add/remove/force
|
||||
sp_inside_fparen = force # ignore/add/remove/force
|
||||
sp_fparen_brace = add # ignore/add/remove/force
|
||||
sp_func_call_paren = remove # ignore/add/remove/force
|
||||
sp_func_class_paren = remove # ignore/add/remove/force
|
||||
sp_return_paren = remove # ignore/add/remove/force
|
||||
sp_attribute_paren = remove # ignore/add/remove/force
|
||||
sp_defined_paren = remove # ignore/add/remove/force
|
||||
sp_macro = force # ignore/add/remove/force
|
||||
sp_macro_func = force # ignore/add/remove/force
|
||||
sp_brace_typedef = force # ignore/add/remove/force
|
||||
sp_before_dc = remove # ignore/add/remove/force
|
||||
sp_after_dc = remove # ignore/add/remove/force
|
||||
sp_cond_colon = force # ignore/add/remove/force
|
||||
sp_cond_question = force # ignore/add/remove/force
|
||||
sp_case_label = force # ignore/add/remove/force
|
||||
sp_endif_cmt = force # ignore/add/remove/force
|
||||
sp_before_tr_emb_cmt = force # ignore/add/remove/force
|
||||
sp_num_before_tr_emb_cmt = 1 # unsigned number
|
||||
indent_columns = 4 # unsigned number
|
||||
indent_with_tabs = 0 # unsigned number
|
||||
indent_align_string = true # false/true
|
||||
indent_class = true # false/true
|
||||
indent_class_colon = true # false/true
|
||||
indent_member = 3 # unsigned number
|
||||
indent_switch_case = 4 # unsigned number
|
||||
indent_case_brace = 3 # number
|
||||
nl_assign_leave_one_liners = true # false/true
|
||||
nl_class_leave_one_liners = true # false/true
|
||||
nl_start_of_file = remove # ignore/add/remove/force
|
||||
nl_end_of_file = force # ignore/add/remove/force
|
||||
nl_end_of_file_min = 1 # unsigned number
|
||||
nl_assign_brace = add # ignore/add/remove/force
|
||||
nl_func_var_def_blk = 1 # unsigned number
|
||||
nl_fcall_brace = add # ignore/add/remove/force
|
||||
nl_enum_brace = force # ignore/add/remove/force
|
||||
nl_struct_brace = force # ignore/add/remove/force
|
||||
nl_union_brace = force # ignore/add/remove/force
|
||||
nl_if_brace = add # ignore/add/remove/force
|
||||
nl_brace_else = add # ignore/add/remove/force
|
||||
nl_else_brace = add # ignore/add/remove/force
|
||||
nl_getset_brace = force # ignore/add/remove/force
|
||||
nl_for_brace = add # ignore/add/remove/force
|
||||
nl_while_brace = add # ignore/add/remove/force
|
||||
nl_do_brace = add # ignore/add/remove/force
|
||||
nl_switch_brace = add # ignore/add/remove/force
|
||||
nl_multi_line_define = true # false/true
|
||||
nl_before_case = true # false/true
|
||||
nl_after_case = true # false/true
|
||||
nl_func_type_name = remove # ignore/add/remove/force
|
||||
nl_func_proto_type_name = remove # ignore/add/remove/force
|
||||
nl_func_paren = remove # ignore/add/remove/force
|
||||
nl_func_def_paren = remove # ignore/add/remove/force
|
||||
nl_func_decl_start = remove # ignore/add/remove/force
|
||||
nl_func_def_start = remove # ignore/add/remove/force
|
||||
nl_func_decl_args = add # ignore/add/remove/force
|
||||
nl_func_def_args = add # ignore/add/remove/force
|
||||
nl_func_decl_end = remove # ignore/add/remove/force
|
||||
nl_func_def_end = remove # ignore/add/remove/force
|
||||
nl_fdef_brace = add # ignore/add/remove/force
|
||||
nl_after_semicolon = true # false/true
|
||||
nl_after_brace_open = true # false/true
|
||||
nl_after_brace_close = true # false/true
|
||||
nl_squeeze_ifdef = true # false/true
|
||||
nl_before_if = force # ignore/add/remove/force
|
||||
nl_after_if = force # ignore/add/remove/force
|
||||
nl_before_for = force # ignore/add/remove/force
|
||||
nl_after_for = force # ignore/add/remove/force
|
||||
nl_before_while = force # ignore/add/remove/force
|
||||
nl_after_while = force # ignore/add/remove/force
|
||||
nl_before_switch = force # ignore/add/remove/force
|
||||
nl_after_switch = force # ignore/add/remove/force
|
||||
nl_before_do = force # ignore/add/remove/force
|
||||
nl_after_do = force # ignore/add/remove/force
|
||||
nl_max = 4 # unsigned number
|
||||
nl_after_func_proto_group = 1 # unsigned number
|
||||
nl_after_func_body_class = 2 # unsigned number
|
||||
nl_before_block_comment = 2 # unsigned number
|
||||
eat_blanks_after_open_brace = true # false/true
|
||||
eat_blanks_before_close_brace = true # false/true
|
||||
nl_after_return = true # false/true
|
||||
pos_bool = trail # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force
|
||||
align_var_def_amp_style = 1 # unsigned number
|
||||
align_var_def_thresh = 16 # unsigned number
|
||||
align_assign_thresh = 12 # unsigned number
|
||||
align_struct_init_span = 3 # unsigned number
|
||||
align_typedef_gap = 3 # unsigned number
|
||||
align_typedef_span = 5 # unsigned number
|
||||
align_typedef_star_style = 1 # unsigned number
|
||||
align_typedef_amp_style = 1 # unsigned number
|
||||
align_right_cmt_span = 3 # unsigned number
|
||||
align_nl_cont = true # false/true
|
||||
align_pp_define_gap = 4 # unsigned number
|
||||
align_pp_define_span = 3 # unsigned number
|
||||
cmt_cpp_to_c = true # false/true
|
||||
cmt_star_cont = true # false/true
|
||||
mod_full_brace_do = add # ignore/add/remove/force
|
||||
mod_full_brace_for = add # ignore/add/remove/force
|
||||
mod_full_brace_if = add # ignore/add/remove/force
|
||||
mod_full_brace_while = add # ignore/add/remove/force
|
||||
mod_full_paren_if_bool = true # false/true
|
||||
mod_remove_extra_semicolon = true # false/true
|
||||
mod_add_long_ifdef_endif_comment = 10 # unsigned number
|
||||
mod_add_long_ifdef_else_comment = 10 # unsigned number
|
||||
mod_case_brace = remove # ignore/add/remove/force
|
||||
mod_remove_empty_return = true # false/true
|
||||
pp_indent = force # ignore/add/remove/force
|
||||
pp_indent_at_level = true # false/true
|
||||
pp_indent_count = 4 # unsigned number
|
||||
pp_space = remove # ignore/add/remove/force
|
||||
pp_if_indent_code = true # false/true
|
||||
# option(s) with 'not default' value: 158
|
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
|
@ -34,6 +34,27 @@ jobs:
|
|||
else
|
||||
exit 1
|
||||
fi
|
||||
formatting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Uncrustify
|
||||
run: sudo apt-get install uncrustify
|
||||
- name: Run Uncrustify
|
||||
run: |
|
||||
uncrustify --version
|
||||
find . \( -name portable \) -prune -false -o -iname "*.[hc]" -exec uncrustify --check -c .github/uncrustify.cfg {} +
|
||||
- name: Check For Trailing Whitespace
|
||||
run: |
|
||||
set +e
|
||||
grep --exclude="README.md" --exclude-dir="portable" -rnI -e "[[:blank:]]$" .
|
||||
if [ "$?" = "0" ]; then
|
||||
echo "Files have trailing whitespace."
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
url-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
* contains the typedefs required to build FreeRTOS. Read the instructions
|
||||
* in FreeRTOS/source/stdint.readme for more information.
|
||||
*/
|
||||
#include <stdint.h> /* READ COMMENT ABOVE. */
|
||||
#include <stdint.h> /* READ COMMENT ABOVE. */
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
|
@ -130,21 +130,23 @@
|
|||
|
||||
#ifdef INCLUDE_xTaskDelayUntil
|
||||
#ifdef INCLUDE_vTaskDelayUntil
|
||||
/* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward
|
||||
* compatibility is maintained if only one or the other is defined, but
|
||||
* there is a conflict if both are defined. */
|
||||
|
||||
/* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward
|
||||
* compatibility is maintained if only one or the other is defined, but
|
||||
* there is a conflict if both are defined. */
|
||||
#error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined. INCLUDE_vTaskDelayUntil is no longer required and should be removed
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INCLUDE_xTaskDelayUntil
|
||||
#ifdef INCLUDE_vTaskDelayUntil
|
||||
/* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then
|
||||
* the project's FreeRTOSConfig.h probably pre-dates the introduction of
|
||||
* xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever
|
||||
* INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.
|
||||
*/
|
||||
#define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil
|
||||
|
||||
/* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then
|
||||
* the project's FreeRTOSConfig.h probably pre-dates the introduction of
|
||||
* xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever
|
||||
* INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.
|
||||
*/
|
||||
#define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -906,6 +908,7 @@
|
|||
#endif
|
||||
|
||||
#ifndef configRUN_TIME_COUNTER_TYPE
|
||||
|
||||
/* Defaults to uint32_t for backward compatibility, but can be overridden in
|
||||
* FreeRTOSConfig.h if uint32_t is too restrictive. */
|
||||
|
||||
|
|
|
@ -307,23 +307,23 @@ typedef struct xLIST
|
|||
* \page listREMOVE_ITEM listREMOVE_ITEM
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#define listREMOVE_ITEM( pxItemToRemove ) \
|
||||
{ \
|
||||
/* The list item knows which list it is in. Obtain the list from the list \
|
||||
* item. */ \
|
||||
List_t * const pxList = ( pxItemToRemove )->pxContainer; \
|
||||
\
|
||||
( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
|
||||
( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
|
||||
/* Make sure the index is left pointing to a valid item. */ \
|
||||
if( pxList->pxIndex == ( pxItemToRemove ) ) \
|
||||
{ \
|
||||
pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
|
||||
} \
|
||||
\
|
||||
( pxItemToRemove )->pxContainer = NULL; \
|
||||
( pxList->uxNumberOfItems )--; \
|
||||
}
|
||||
#define listREMOVE_ITEM( pxItemToRemove ) \
|
||||
{ \
|
||||
/* The list item knows which list it is in. Obtain the list from the list \
|
||||
* item. */ \
|
||||
List_t * const pxList = ( pxItemToRemove )->pxContainer; \
|
||||
\
|
||||
( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
|
||||
( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
|
||||
/* Make sure the index is left pointing to a valid item. */ \
|
||||
if( pxList->pxIndex == ( pxItemToRemove ) ) \
|
||||
{ \
|
||||
pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
|
||||
} \
|
||||
\
|
||||
( pxItemToRemove )->pxContainer = NULL; \
|
||||
( pxList->uxNumberOfItems )--; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Inline version of vListInsertEnd() to provide slight optimisation for
|
||||
|
@ -347,30 +347,30 @@ typedef struct xLIST
|
|||
* \page listINSERT_END listINSERT_END
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#define listINSERT_END( pxList, pxNewListItem ) \
|
||||
{ \
|
||||
ListItem_t * const pxIndex = ( pxList )->pxIndex; \
|
||||
\
|
||||
/* Only effective when configASSERT() is also defined, these tests may catch \
|
||||
* the list data structures being overwritten in memory. They will not catch \
|
||||
* data errors caused by incorrect configuration or use of FreeRTOS. */ \
|
||||
listTEST_LIST_INTEGRITY( ( pxList ) ); \
|
||||
listTEST_LIST_ITEM_INTEGRITY( ( pxNewListItem ) ); \
|
||||
\
|
||||
/* Insert a new list item into ( pxList ), but rather than sort the list, \
|
||||
* makes the new list item the last item to be removed by a call to \
|
||||
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
|
||||
( pxNewListItem )->pxNext = pxIndex; \
|
||||
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
|
||||
\
|
||||
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
|
||||
pxIndex->pxPrevious = ( pxNewListItem ); \
|
||||
\
|
||||
/* Remember which list the item is in. */ \
|
||||
( pxNewListItem )->pxContainer = ( pxList ); \
|
||||
\
|
||||
( ( pxList )->uxNumberOfItems )++; \
|
||||
}
|
||||
#define listINSERT_END( pxList, pxNewListItem ) \
|
||||
{ \
|
||||
ListItem_t * const pxIndex = ( pxList )->pxIndex; \
|
||||
\
|
||||
/* Only effective when configASSERT() is also defined, these tests may catch \
|
||||
* the list data structures being overwritten in memory. They will not catch \
|
||||
* data errors caused by incorrect configuration or use of FreeRTOS. */ \
|
||||
listTEST_LIST_INTEGRITY( ( pxList ) ); \
|
||||
listTEST_LIST_ITEM_INTEGRITY( ( pxNewListItem ) ); \
|
||||
\
|
||||
/* Insert a new list item into ( pxList ), but rather than sort the list, \
|
||||
* makes the new list item the last item to be removed by a call to \
|
||||
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
|
||||
( pxNewListItem )->pxNext = pxIndex; \
|
||||
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
|
||||
\
|
||||
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
|
||||
pxIndex->pxPrevious = ( pxNewListItem ); \
|
||||
\
|
||||
/* Remember which list the item is in. */ \
|
||||
( pxNewListItem )->pxContainer = ( pxList ); \
|
||||
\
|
||||
( ( pxList )->uxNumberOfItems )++; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Access function to obtain the owner of the first entry in a list. Lists
|
||||
|
|
|
@ -55,7 +55,7 @@ TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
|||
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
||||
const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
|
||||
const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
|
|
|
@ -65,12 +65,12 @@
|
|||
#define portBYTE_ALIGNMENT_MASK ( 0x0001 )
|
||||
#elif portBYTE_ALIGNMENT == 1
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x0000 )
|
||||
#else
|
||||
#else /* if portBYTE_ALIGNMENT == 32 */
|
||||
#error "Invalid portBYTE_ALIGNMENT definition"
|
||||
#endif
|
||||
#endif /* if portBYTE_ALIGNMENT == 32 */
|
||||
|
||||
#ifndef portUSING_MPU_WRAPPERS
|
||||
#define portUSING_MPU_WRAPPERS 0
|
||||
#define portUSING_MPU_WRAPPERS 0
|
||||
#endif
|
||||
|
||||
#ifndef portNUM_CONFIGURABLE_REGIONS
|
||||
|
@ -87,7 +87,7 @@
|
|||
|
||||
#ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
|
||||
/* Defaults to 0 for backward compatibility. */
|
||||
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
||||
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
||||
#endif
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
@ -141,13 +141,13 @@ typedef struct HeapRegion
|
|||
/* Used to pass information about the heap out of vPortGetHeapStats(). */
|
||||
typedef struct xHeapStats
|
||||
{
|
||||
size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
|
||||
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
|
||||
size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
|
||||
size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
|
||||
size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
|
||||
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
|
||||
size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
|
||||
size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
|
||||
} HeapStats_t;
|
||||
|
||||
/*
|
||||
|
@ -178,12 +178,12 @@ void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
|
|||
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if( configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1 )
|
||||
void *pvPortMallocStack( size_t xSize ) PRIVILEGED_FUNCTION;
|
||||
void vPortFreeStack( void *pv ) PRIVILEGED_FUNCTION;
|
||||
#if ( configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1 )
|
||||
void * pvPortMallocStack( size_t xSize ) PRIVILEGED_FUNCTION;
|
||||
void vPortFreeStack( void * pv ) PRIVILEGED_FUNCTION;
|
||||
#else
|
||||
#define pvPortMallocStack pvPortMalloc
|
||||
#define vPortFreeStack vPortFree
|
||||
#define pvPortMallocStack pvPortMalloc
|
||||
#define vPortFreeStack vPortFree
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -1184,6 +1184,6 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
|||
* semaphore is not available.
|
||||
*
|
||||
*/
|
||||
#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) )
|
||||
#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) )
|
||||
|
||||
#endif /* SEMAPHORE_H */
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
* use on the stack.
|
||||
*/
|
||||
#ifndef portSTACK_LIMIT_PADDING
|
||||
#define portSTACK_LIMIT_PADDING 0
|
||||
#define portSTACK_LIMIT_PADDING 0
|
||||
#endif
|
||||
|
||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
|
||||
|
@ -59,7 +59,7 @@
|
|||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||
{ \
|
||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING) \
|
||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
|
||||
{ \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||
} \
|
||||
|
@ -75,7 +75,7 @@
|
|||
{ \
|
||||
\
|
||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING) \
|
||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
|
||||
{ \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||
} \
|
||||
|
|
140
include/task.h
140
include/task.h
|
@ -83,7 +83,7 @@
|
|||
* \defgroup TaskHandle_t TaskHandle_t
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
struct tskTaskControlBlock; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||
struct tskTaskControlBlock; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||
typedef struct tskTaskControlBlock * TaskHandle_t;
|
||||
|
||||
/*
|
||||
|
@ -95,22 +95,22 @@ typedef BaseType_t (* TaskHookFunction_t)( void * );
|
|||
/* Task states returned by eTaskGetState. */
|
||||
typedef enum
|
||||
{
|
||||
eRunning = 0, /* A task is querying the state of itself, so must be running. */
|
||||
eReady, /* The task being queried is in a ready or pending ready list. */
|
||||
eBlocked, /* The task being queried is in the Blocked state. */
|
||||
eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
|
||||
eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */
|
||||
eInvalid /* Used as an 'invalid state' value. */
|
||||
eRunning = 0, /* A task is querying the state of itself, so must be running. */
|
||||
eReady, /* The task being queried is in a ready or pending ready list. */
|
||||
eBlocked, /* The task being queried is in the Blocked state. */
|
||||
eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
|
||||
eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */
|
||||
eInvalid /* Used as an 'invalid state' value. */
|
||||
} eTaskState;
|
||||
|
||||
/* Actions that can be performed when vTaskNotify() is called. */
|
||||
typedef enum
|
||||
{
|
||||
eNoAction = 0, /* Notify the task without updating its notify value. */
|
||||
eSetBits, /* Set bits in the task's notification value. */
|
||||
eIncrement, /* Increment the task's notification value. */
|
||||
eSetValueWithOverwrite, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
|
||||
eSetValueWithoutOverwrite /* Set the task's notification value if the previous value has been read by the task. */
|
||||
eNoAction = 0, /* Notify the task without updating its notify value. */
|
||||
eSetBits, /* Set bits in the task's notification value. */
|
||||
eIncrement, /* Increment the task's notification value. */
|
||||
eSetValueWithOverwrite, /* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
|
||||
eSetValueWithoutOverwrite /* Set the task's notification value if the previous value has been read by the task. */
|
||||
} eNotifyAction;
|
||||
|
||||
/*
|
||||
|
@ -138,7 +138,7 @@ typedef struct xMEMORY_REGION
|
|||
typedef struct xTASK_PARAMETERS
|
||||
{
|
||||
TaskFunction_t pvTaskCode;
|
||||
const char * pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const char * pcName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
configSTACK_DEPTH_TYPE usStackDepth;
|
||||
void * pvParameters;
|
||||
UBaseType_t uxPriority;
|
||||
|
@ -153,23 +153,23 @@ typedef struct xTASK_PARAMETERS
|
|||
* in the system. */
|
||||
typedef struct xTASK_STATUS
|
||||
{
|
||||
TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
|
||||
const char * pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
UBaseType_t xTaskNumber; /* A number unique to the task. */
|
||||
eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */
|
||||
UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
|
||||
UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
|
||||
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
|
||||
StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
|
||||
configSTACK_DEPTH_TYPE usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
|
||||
TaskHandle_t xHandle; /* The handle of the task to which the rest of the information in the structure relates. */
|
||||
const char * pcTaskName; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
UBaseType_t xTaskNumber; /* A number unique to the task. */
|
||||
eTaskState eCurrentState; /* The state in which the task existed when the structure was populated. */
|
||||
UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
|
||||
UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
|
||||
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
|
||||
StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
|
||||
configSTACK_DEPTH_TYPE usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
|
||||
} TaskStatus_t;
|
||||
|
||||
/* Possible return values for eTaskConfirmSleepModeStatus(). */
|
||||
typedef enum
|
||||
{
|
||||
eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
|
||||
eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
|
||||
eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
|
||||
eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
|
||||
eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
|
||||
eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
|
||||
} eSleepModeStatus;
|
||||
|
||||
/**
|
||||
|
@ -347,7 +347,7 @@ typedef enum
|
|||
*/
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
BaseType_t xTaskCreate( TaskFunction_t pxTaskCode,
|
||||
const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const configSTACK_DEPTH_TYPE usStackDepth,
|
||||
void * const pvParameters,
|
||||
UBaseType_t uxPriority,
|
||||
|
@ -357,7 +357,7 @@ typedef enum
|
|||
/**
|
||||
* task. h
|
||||
* <pre>
|
||||
* TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
||||
* TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
||||
* const char *pcName,
|
||||
* uint32_t ulStackDepth,
|
||||
* void *pvParameters,
|
||||
|
@ -464,7 +464,7 @@ typedef enum
|
|||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
||||
const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const uint32_t ulStackDepth,
|
||||
void * const pvParameters,
|
||||
UBaseType_t uxPriority,
|
||||
|
@ -859,10 +859,10 @@ BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
|||
* vTaskDelayUntil() is the older version of xTaskDelayUntil() and does not
|
||||
* return a value.
|
||||
*/
|
||||
#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \
|
||||
{ \
|
||||
( void ) xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); \
|
||||
}
|
||||
#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \
|
||||
{ \
|
||||
( void ) xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1475,7 +1475,7 @@ UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;
|
|||
* \defgroup pcTaskGetName pcTaskGetName
|
||||
* \ingroup TaskUtils
|
||||
*/
|
||||
char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
/**
|
||||
* task. h
|
||||
|
@ -1491,7 +1491,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lin
|
|||
* \defgroup pcTaskGetHandle pcTaskGetHandle
|
||||
* \ingroup TaskUtils
|
||||
*/
|
||||
TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
TaskHandle_t xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
/**
|
||||
* task.h
|
||||
|
@ -1611,48 +1611,50 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL
|
|||
|
||||
#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
|
||||
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationStackOverflowHook( TaskHandle_t xTask char *pcTaskName); </pre>
|
||||
*
|
||||
* The application stack overflow hook is called when a stack overflow is detected for a task.
|
||||
*
|
||||
* Details on stack overflow detection can be found here: https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
|
||||
*
|
||||
* @param xTask the task that just exceeded its stack boundaries.
|
||||
* @param pcTaskName A character string containing the name of the offending task.
|
||||
*/
|
||||
void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
||||
char * pcTaskName );
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationStackOverflowHook( TaskHandle_t xTask char *pcTaskName); </pre>
|
||||
*
|
||||
* The application stack overflow hook is called when a stack overflow is detected for a task.
|
||||
*
|
||||
* Details on stack overflow detection can be found here: https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
|
||||
*
|
||||
* @param xTask the task that just exceeded its stack boundaries.
|
||||
* @param pcTaskName A character string containing the name of the offending task.
|
||||
*/
|
||||
void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
||||
char * pcTaskName );
|
||||
|
||||
#endif
|
||||
|
||||
#if ( configUSE_TICK_HOOK > 0 )
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationTickHook( void ); </pre>
|
||||
*
|
||||
* This hook function is called in the system tick handler after any OS work is completed.
|
||||
*/
|
||||
#if ( configUSE_TICK_HOOK > 0 )
|
||||
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationTickHook( void ); </pre>
|
||||
*
|
||||
* This hook function is called in the system tick handler after any OS work is completed.
|
||||
*/
|
||||
void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||
|
||||
#endif
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) </pre>
|
||||
*
|
||||
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB. This function is required when
|
||||
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||
*
|
||||
* @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer
|
||||
* @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
|
||||
* @param pulIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||
*/
|
||||
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) </pre>
|
||||
*
|
||||
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB. This function is required when
|
||||
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||
*
|
||||
* @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer
|
||||
* @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
|
||||
* @param pulIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||
*/
|
||||
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
|
||||
StackType_t ** ppxIdleTaskStackBuffer,
|
||||
uint32_t * pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||
StackType_t ** ppxIdleTaskStackBuffer,
|
||||
uint32_t * pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -1828,7 +1830,7 @@ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
|
|||
* \defgroup vTaskList vTaskList
|
||||
* \ingroup TaskUtils
|
||||
*/
|
||||
void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
/**
|
||||
* task. h
|
||||
|
@ -1882,7 +1884,7 @@ void vTaskList( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unq
|
|||
* \defgroup vTaskGetRunTimeStats vTaskGetRunTimeStats
|
||||
* \ingroup TaskUtils
|
||||
*/
|
||||
void vTaskGetRunTimeStats( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
void vTaskGetRunTimeStats( char * pcWriteBuffer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
/**
|
||||
* task. h
|
||||
|
|
|
@ -1328,20 +1328,20 @@ BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
|
|||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize ) </pre>
|
||||
*
|
||||
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Timer Task TCB. This function is required when
|
||||
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||
*
|
||||
* @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer
|
||||
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task
|
||||
* @param pulTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||
*/
|
||||
/**
|
||||
* task.h
|
||||
* <pre>void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize ) </pre>
|
||||
*
|
||||
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Timer Task TCB. This function is required when
|
||||
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||
*
|
||||
* @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer
|
||||
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task
|
||||
* @param pulTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||
*/
|
||||
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
|
||||
StackType_t ** ppxTimerTaskStackBuffer,
|
||||
uint32_t * pulTimerTaskStackSize );
|
||||
StackType_t ** ppxTimerTaskStackBuffer,
|
||||
uint32_t * pulTimerTaskStackSize );
|
||||
|
||||
#endif
|
||||
|
||||
|
|
3
queue.c
3
queue.c
|
@ -314,6 +314,7 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
|
|||
vListInitialise( &( pxQueue->xTasksWaitingToSend ) );
|
||||
vListInitialise( &( pxQueue->xTasksWaitingToReceive ) );
|
||||
}
|
||||
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
else
|
||||
|
@ -345,12 +346,12 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
|
|||
|
||||
if( ( uxQueueLength > ( UBaseType_t ) 0 ) &&
|
||||
( pxStaticQueue != NULL ) &&
|
||||
|
||||
/* A queue storage area should be provided if the item size is not 0, and
|
||||
* should not be provided if the item size is 0. */
|
||||
( !( ( pucQueueStorage != NULL ) && ( uxItemSize == 0 ) ) ) &&
|
||||
( !( ( pucQueueStorage == NULL ) && ( uxItemSize != 0 ) ) ) )
|
||||
{
|
||||
|
||||
#if ( configASSERT_DEFINED == 1 )
|
||||
{
|
||||
/* Sanity check that the size of the structure used to declare a
|
||||
|
|
|
@ -503,14 +503,15 @@ size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer )
|
|||
configASSERT( pxStreamBuffer );
|
||||
|
||||
/* The code below reads xTail and then xHead. This is safe if the stream
|
||||
buffer is updated once between the two reads - but not if the stream buffer
|
||||
is updated more than once between the two reads - hence the loop. */
|
||||
* buffer is updated once between the two reads - but not if the stream buffer
|
||||
* is updated more than once between the two reads - hence the loop. */
|
||||
do
|
||||
{
|
||||
xOriginalTail = pxStreamBuffer->xTail;
|
||||
xSpace = pxStreamBuffer->xLength + pxStreamBuffer->xTail;
|
||||
xSpace -= pxStreamBuffer->xHead;
|
||||
} while( xOriginalTail != pxStreamBuffer->xTail );
|
||||
|
||||
xSpace -= ( size_t ) 1;
|
||||
|
||||
if( xSpace >= pxStreamBuffer->xLength )
|
||||
|
@ -885,8 +886,8 @@ size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer )
|
|||
/* The number of bytes available is greater than the number of bytes
|
||||
* required to hold the length of the next message, so another message
|
||||
* is available. */
|
||||
( void ) prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) &xTempReturn, sbBYTES_TO_STORE_MESSAGE_LENGTH, pxStreamBuffer->xTail );
|
||||
xReturn = ( size_t ) xTempReturn;
|
||||
( void ) prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) &xTempReturn, sbBYTES_TO_STORE_MESSAGE_LENGTH, pxStreamBuffer->xTail );
|
||||
xReturn = ( size_t ) xTempReturn;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1009,7 +1010,7 @@ static size_t prvReadMessageFromBuffer( StreamBuffer_t * pxStreamBuffer,
|
|||
if( xCount != ( size_t ) 0 )
|
||||
{
|
||||
/* Read the actual data and update the tail to mark the data as officially consumed. */
|
||||
pxStreamBuffer->xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xNextTail); /*lint !e9079 Data storage area is implemented as uint8_t array for ease of sizing, indexing and alignment. */
|
||||
pxStreamBuffer->xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xNextTail ); /*lint !e9079 Data storage area is implemented as uint8_t array for ease of sizing, indexing and alignment. */
|
||||
}
|
||||
|
||||
return xCount;
|
||||
|
|
30
tasks.c
30
tasks.c
|
@ -297,6 +297,7 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
|
|||
#endif
|
||||
|
||||
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
||||
|
||||
/* Allocate a Newlib reent structure that is specific to this task.
|
||||
* Note Newlib support has been included by popular demand, but is not
|
||||
* used by the FreeRTOS maintainers themselves. FreeRTOS is not
|
||||
|
@ -916,6 +917,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
|||
|
||||
/* This is used as an array index so must ensure it's not too large. */
|
||||
configASSERT( uxPriority < configMAX_PRIORITIES );
|
||||
|
||||
if( uxPriority >= ( UBaseType_t ) configMAX_PRIORITIES )
|
||||
{
|
||||
uxPriority = ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) 1U;
|
||||
|
@ -5277,28 +5279,28 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
{
|
||||
configRUN_TIME_COUNTER_TYPE ulTotalTime, ulReturn;
|
||||
|
||||
ulTotalTime = portGET_RUN_TIME_COUNTER_VALUE();
|
||||
ulTotalTime = portGET_RUN_TIME_COUNTER_VALUE();
|
||||
|
||||
/* For percentage calculations. */
|
||||
ulTotalTime /= ( configRUN_TIME_COUNTER_TYPE ) 100;
|
||||
/* For percentage calculations. */
|
||||
ulTotalTime /= ( configRUN_TIME_COUNTER_TYPE ) 100;
|
||||
|
||||
/* Avoid divide by zero errors. */
|
||||
if( ulTotalTime > ( configRUN_TIME_COUNTER_TYPE ) 0 )
|
||||
{
|
||||
ulReturn = xIdleTaskHandle->ulRunTimeCounter / ulTotalTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
ulReturn = 0;
|
||||
}
|
||||
/* Avoid divide by zero errors. */
|
||||
if( ulTotalTime > ( configRUN_TIME_COUNTER_TYPE ) 0 )
|
||||
{
|
||||
ulReturn = xIdleTaskHandle->ulRunTimeCounter / ulTotalTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
ulReturn = 0;
|
||||
}
|
||||
|
||||
return ulReturn;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
|
||||
static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
|
||||
const BaseType_t xCanBlockIndefinitely )
|
||||
{
|
||||
TickType_t xTimeToWake;
|
||||
|
|
11
timers.c
11
timers.c
|
@ -57,8 +57,8 @@
|
|||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
/* Misc definitions. */
|
||||
#define tmrNO_DELAY ( ( TickType_t ) 0U )
|
||||
#define tmrMAX_TIME_BEFORE_OVERFLOW ( ( TickType_t ) -1 )
|
||||
#define tmrNO_DELAY ( ( TickType_t ) 0U )
|
||||
#define tmrMAX_TIME_BEFORE_OVERFLOW ( ( TickType_t ) -1 )
|
||||
|
||||
/* The name assigned to the timer service task. This can be overridden by
|
||||
* defining trmTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
|
||||
|
@ -363,11 +363,11 @@
|
|||
configASSERT( ( xTimerPeriodInTicks > 0 ) );
|
||||
|
||||
/* Ensure the infrastructure used by the timer service task has been
|
||||
* created/initialised. */
|
||||
* created/initialised. */
|
||||
prvCheckForValidListAndQueue();
|
||||
|
||||
/* Initialise the timer structure members using the function
|
||||
* parameters. */
|
||||
* parameters. */
|
||||
pxNewTimer->pcTimerName = pcTimerName;
|
||||
pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
|
||||
pxNewTimer->pvTimerID = pvTimerID;
|
||||
|
@ -521,7 +521,7 @@
|
|||
/* Insert the timer into the appropriate list for the next expiry time.
|
||||
* If the next expiry time has already passed, advance the expiry time,
|
||||
* call the callback function, and try again. */
|
||||
while ( prvInsertTimerInActiveList( pxTimer, ( xExpiredTime + pxTimer->xTimerPeriodInTicks ), xTimeNow, xExpiredTime ) != pdFALSE )
|
||||
while( prvInsertTimerInActiveList( pxTimer, ( xExpiredTime + pxTimer->xTimerPeriodInTicks ), xTimeNow, xExpiredTime ) != pdFALSE )
|
||||
{
|
||||
/* Advance the expiry time. */
|
||||
xExpiredTime += pxTimer->xTimerPeriodInTicks;
|
||||
|
@ -540,6 +540,7 @@
|
|||
|
||||
/* Remove the timer from the list of active timers. A check has already
|
||||
* been performed to ensure the list is not empty. */
|
||||
|
||||
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );
|
||||
|
||||
/* If the timer is an auto-reload timer then calculate the next
|
||||
|
|
Loading…
Reference in a new issue