mirror of
https://github.com/GorgonMeducer/perf_counter.git
synced 2025-01-17 19:13:03 +08:00
format code
This commit is contained in:
parent
7f4bc4c59f
commit
2bff1d5c43
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2019, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
|
@ -116,8 +116,8 @@ typedef struct
|
||||
/* ================ Peripheral declaration ================ */
|
||||
/* ================================================================================ */
|
||||
|
||||
//#define CMSDK_UART0_BASE_ADDRESS (0x41303000ul)
|
||||
#define CMSDK_UART0_BASE_ADDRESS (0x40004000ul)
|
||||
//#define CMSDK_UART0_BASE_ADDRESS (0x41303000ul)
|
||||
#define CMSDK_UART0_BASE_ADDRESS (0x40004000ul)
|
||||
#define CMSDK_UART0 ((CMSDK_UART_TypeDef *) CMSDK_UART0_BASE_ADDRESS)
|
||||
|
||||
|
||||
@ -162,16 +162,16 @@ int _write (int fd, char *ptr, int len)
|
||||
|
||||
int stderr_putchar(char txchar)
|
||||
{
|
||||
return stdout_putchar(txchar);
|
||||
return stdout_putchar(txchar);
|
||||
}
|
||||
|
||||
void ttywrch (int ch)
|
||||
{
|
||||
stdout_putchar(ch);
|
||||
stdout_putchar(ch);
|
||||
}
|
||||
|
||||
|
||||
#define log_str(...) \
|
||||
#define log_str(...) \
|
||||
do { \
|
||||
const char *pchSrc = __VA_ARGS__; \
|
||||
uint_fast16_t hwSize = sizeof(__VA_ARGS__); \
|
||||
@ -184,11 +184,11 @@ __NO_RETURN
|
||||
void _sys_exit(int n)
|
||||
{
|
||||
UNUSED_PARAM(n);
|
||||
log_str("\r\n");
|
||||
log_str("_[TEST COMPLETE]_________________________________________________\r\n");
|
||||
log_str("\r\n\r\n");
|
||||
log_str("\r\n");
|
||||
log_str("_[TEST COMPLETE]_________________________________________________\r\n");
|
||||
log_str("\r\n\r\n");
|
||||
|
||||
while(1) {
|
||||
while(1) {
|
||||
__asm volatile ("nop");
|
||||
}
|
||||
}
|
||||
|
@ -74,82 +74,82 @@ struct __task_cycle_info_t {
|
||||
* and stores task state information, including a pointer to the task's context
|
||||
* (the task's run time environment, including register values)
|
||||
*/
|
||||
typedef struct tskTaskControlBlock /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||
typedef struct tskTaskControlBlock /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||
{
|
||||
volatile StackType_t *pxTopOfStack; /*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
|
||||
volatile StackType_t *pxTopOfStack; /*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
|
||||
|
||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||
xMPU_SETTINGS xMPUSettings; /*< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
|
||||
#endif
|
||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||
xMPU_SETTINGS xMPUSettings; /*< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
|
||||
#endif
|
||||
|
||||
ListItem_t xStateListItem; /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
|
||||
ListItem_t xEventListItem; /*< Used to reference a task from an event list. */
|
||||
UBaseType_t uxPriority; /*< The priority of the task. 0 is the lowest priority. */
|
||||
StackType_t *pxStack; /*< Points to the start of the stack. */
|
||||
char pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
ListItem_t xStateListItem; /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
|
||||
ListItem_t xEventListItem; /*< Used to reference a task from an event list. */
|
||||
UBaseType_t uxPriority; /*< The priority of the task. 0 is the lowest priority. */
|
||||
StackType_t *pxStack; /*< Points to the start of the stack. */
|
||||
char pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
|
||||
StackType_t *pxEndOfStack; /*< Points to the highest valid address for the stack. */
|
||||
#endif
|
||||
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
|
||||
StackType_t *pxEndOfStack; /*< Points to the highest valid address for the stack. */
|
||||
#endif
|
||||
|
||||
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
|
||||
UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
|
||||
#endif
|
||||
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
|
||||
UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
|
||||
#endif
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxTCBNumber; /*< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
|
||||
UBaseType_t uxTaskNumber; /*< Stores a number specifically for use by third party trace code. */
|
||||
#endif
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxTCBNumber; /*< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
|
||||
UBaseType_t uxTaskNumber; /*< Stores a number specifically for use by third party trace code. */
|
||||
#endif
|
||||
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
UBaseType_t uxBasePriority; /*< The priority last assigned to the task - used by the priority inheritance mechanism. */
|
||||
UBaseType_t uxMutexesHeld;
|
||||
#endif
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
UBaseType_t uxBasePriority; /*< The priority last assigned to the task - used by the priority inheritance mechanism. */
|
||||
UBaseType_t uxMutexesHeld;
|
||||
#endif
|
||||
|
||||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
TaskHookFunction_t pxTaskTag;
|
||||
#endif
|
||||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
TaskHookFunction_t pxTaskTag;
|
||||
#endif
|
||||
|
||||
#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
|
||||
void *pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
|
||||
#endif
|
||||
#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
|
||||
void *pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
|
||||
#endif
|
||||
|
||||
#if( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
uint32_t ulRunTimeCounter; /*< Stores the amount of time the task has spent in the Running state. */
|
||||
#endif
|
||||
#if( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
uint32_t ulRunTimeCounter; /*< Stores the amount of time the task has spent in the Running state. */
|
||||
#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
|
||||
responsible for resulting newlib operation. User must be familiar with
|
||||
newlib and must provide system-wide implementations of the necessary
|
||||
stubs. Be warned that (at the time of writing) the current newlib design
|
||||
implements a system-wide malloc() that must be provided with locks.
|
||||
#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
|
||||
responsible for resulting newlib operation. User must be familiar with
|
||||
newlib and must provide system-wide implementations of the necessary
|
||||
stubs. Be warned that (at the time of writing) the current newlib design
|
||||
implements a system-wide malloc() that must be provided with locks.
|
||||
|
||||
See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
|
||||
for additional information. */
|
||||
struct _reent xNewLib_reent;
|
||||
#endif
|
||||
See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
|
||||
for additional information. */
|
||||
struct _reent xNewLib_reent;
|
||||
#endif
|
||||
|
||||
#if( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
volatile uint32_t ulNotifiedValue;
|
||||
volatile uint8_t ucNotifyState;
|
||||
#endif
|
||||
#if( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
volatile uint32_t ulNotifiedValue;
|
||||
volatile uint8_t ucNotifyState;
|
||||
#endif
|
||||
|
||||
/* See the comments in FreeRTOS.h with the definition of
|
||||
tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */
|
||||
#if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
/* See the comments in FreeRTOS.h with the definition of
|
||||
tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */
|
||||
#if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
|
||||
#if( INCLUDE_xTaskAbortDelay == 1 )
|
||||
uint8_t ucDelayAborted;
|
||||
#endif
|
||||
#if( INCLUDE_xTaskAbortDelay == 1 )
|
||||
uint8_t ucDelayAborted;
|
||||
#endif
|
||||
|
||||
#if( configUSE_POSIX_ERRNO == 1 )
|
||||
int iTaskErrno;
|
||||
#endif
|
||||
#if( configUSE_POSIX_ERRNO == 1 )
|
||||
int iTaskErrno;
|
||||
#endif
|
||||
|
||||
} tskTCB;
|
||||
|
||||
|
@ -74,82 +74,82 @@ struct __task_cycle_info_t {
|
||||
* and stores task state information, including a pointer to the task's context
|
||||
* (the task's run time environment, including register values)
|
||||
*/
|
||||
typedef struct tskTaskControlBlock /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||
typedef struct tskTaskControlBlock /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||
{
|
||||
volatile StackType_t *pxTopOfStack; /*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
|
||||
volatile StackType_t *pxTopOfStack; /*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */
|
||||
|
||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||
xMPU_SETTINGS xMPUSettings; /*< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
|
||||
#endif
|
||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||
xMPU_SETTINGS xMPUSettings; /*< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */
|
||||
#endif
|
||||
|
||||
ListItem_t xStateListItem; /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
|
||||
ListItem_t xEventListItem; /*< Used to reference a task from an event list. */
|
||||
UBaseType_t uxPriority; /*< The priority of the task. 0 is the lowest priority. */
|
||||
StackType_t *pxStack; /*< Points to the start of the stack. */
|
||||
char pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
ListItem_t xStateListItem; /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
|
||||
ListItem_t xEventListItem; /*< Used to reference a task from an event list. */
|
||||
UBaseType_t uxPriority; /*< The priority of the task. 0 is the lowest priority. */
|
||||
StackType_t *pxStack; /*< Points to the start of the stack. */
|
||||
char pcTaskName[ configMAX_TASK_NAME_LEN ];/*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
|
||||
StackType_t *pxEndOfStack; /*< Points to the highest valid address for the stack. */
|
||||
#endif
|
||||
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
|
||||
StackType_t *pxEndOfStack; /*< Points to the highest valid address for the stack. */
|
||||
#endif
|
||||
|
||||
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
|
||||
UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
|
||||
#endif
|
||||
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
|
||||
UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
|
||||
#endif
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxTCBNumber; /*< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
|
||||
UBaseType_t uxTaskNumber; /*< Stores a number specifically for use by third party trace code. */
|
||||
#endif
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxTCBNumber; /*< Stores a number that increments each time a TCB is created. It allows debuggers to determine when a task has been deleted and then recreated. */
|
||||
UBaseType_t uxTaskNumber; /*< Stores a number specifically for use by third party trace code. */
|
||||
#endif
|
||||
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
UBaseType_t uxBasePriority; /*< The priority last assigned to the task - used by the priority inheritance mechanism. */
|
||||
UBaseType_t uxMutexesHeld;
|
||||
#endif
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
UBaseType_t uxBasePriority; /*< The priority last assigned to the task - used by the priority inheritance mechanism. */
|
||||
UBaseType_t uxMutexesHeld;
|
||||
#endif
|
||||
|
||||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
TaskHookFunction_t pxTaskTag;
|
||||
#endif
|
||||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
TaskHookFunction_t pxTaskTag;
|
||||
#endif
|
||||
|
||||
#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
|
||||
void *pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
|
||||
#endif
|
||||
#if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
|
||||
void *pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
|
||||
#endif
|
||||
|
||||
#if( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
uint32_t ulRunTimeCounter; /*< Stores the amount of time the task has spent in the Running state. */
|
||||
#endif
|
||||
#if( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
uint32_t ulRunTimeCounter; /*< Stores the amount of time the task has spent in the Running state. */
|
||||
#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
|
||||
responsible for resulting newlib operation. User must be familiar with
|
||||
newlib and must provide system-wide implementations of the necessary
|
||||
stubs. Be warned that (at the time of writing) the current newlib design
|
||||
implements a system-wide malloc() that must be provided with locks.
|
||||
#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
|
||||
responsible for resulting newlib operation. User must be familiar with
|
||||
newlib and must provide system-wide implementations of the necessary
|
||||
stubs. Be warned that (at the time of writing) the current newlib design
|
||||
implements a system-wide malloc() that must be provided with locks.
|
||||
|
||||
See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
|
||||
for additional information. */
|
||||
struct _reent xNewLib_reent;
|
||||
#endif
|
||||
See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
|
||||
for additional information. */
|
||||
struct _reent xNewLib_reent;
|
||||
#endif
|
||||
|
||||
#if( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
volatile uint32_t ulNotifiedValue;
|
||||
volatile uint8_t ucNotifyState;
|
||||
#endif
|
||||
#if( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
volatile uint32_t ulNotifiedValue;
|
||||
volatile uint8_t ucNotifyState;
|
||||
#endif
|
||||
|
||||
/* See the comments in FreeRTOS.h with the definition of
|
||||
tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */
|
||||
#if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
/* See the comments in FreeRTOS.h with the definition of
|
||||
tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */
|
||||
#if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
|
||||
#if( INCLUDE_xTaskAbortDelay == 1 )
|
||||
uint8_t ucDelayAborted;
|
||||
#endif
|
||||
#if( INCLUDE_xTaskAbortDelay == 1 )
|
||||
uint8_t ucDelayAborted;
|
||||
#endif
|
||||
|
||||
#if( configUSE_POSIX_ERRNO == 1 )
|
||||
int iTaskErrno;
|
||||
#endif
|
||||
#if( configUSE_POSIX_ERRNO == 1 )
|
||||
int iTaskErrno;
|
||||
#endif
|
||||
|
||||
} tskTCB;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user