FreeRTOS-Kernel/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/streamports/Jlink_RTT/trcStreamPort.c
Soren Ptak 3a2f6646f0
Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083)
* Use new version of CI-CD Actions,  checkout@v3 instead of checkout@v2 on all jobs
* Use cSpell spell check, and use ubuntu-20.04 for formatting check
* Add in bot formatting action
* Update freertos_demo.yml and freertos_plus_demo.yml files to increase github log readability
* Add in a Qemu demo onto the workflows.
2023-09-06 12:35:37 -07:00

65 lines
2.4 KiB
C

/*
* Trace Recorder for Tracealyzer v4.6.0
* Copyright 2021 Percepio AB
* www.percepio.com
*
* SPDX-License-Identifier: Apache-2.0
*
* Supporting functions for trace streaming, used by the "stream ports"
* for reading and writing data to the interface.
*
* Note that this stream port is more complex than the typical case, since
* the J-Link interface uses a separate RAM buffer in SEGGER_RTT.c, instead
* of the default buffer included in the recorder core. The other stream ports
* offer more typical examples of how to define a custom streaming interface.
*/
#include <trcRecorder.h>
#if ( TRC_USE_TRACEALYZER_RECORDER == 1 )
#if ( TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING )
typedef struct TraceStreamPortRTT
{
#if ( TRC_USE_INTERNAL_BUFFER == 1 )
uint8_t bufferInternal[ TRC_STREAM_PORT_INTERNAL_BUFFER_SIZE ];
#endif
uint8_t bufferUp[ TRC_STREAM_PORT_RTT_UP_BUFFER_SIZE ];
uint8_t bufferDown[ TRC_STREAM_PORT_RTT_DOWN_BUFFER_SIZE ];
} TraceStreamPortRTT_t;
static TraceStreamPortRTT_t * pxStreamPortRTT;
traceResult xTraceStreamPortInitialize( TraceStreamPortBuffer_t * pxBuffer )
{
TRC_ASSERT_EQUAL_SIZE( TraceStreamPortBuffer_t, TraceStreamPortRTT_t );
if( pxBuffer == 0 )
{
return TRC_FAIL;
}
pxStreamPortRTT = ( TraceStreamPortRTT_t * ) pxBuffer;
#if ( TRC_USE_INTERNAL_BUFFER == 1 )
return xTraceInternalEventBufferInitialize( pxStreamPortRTT->bufferInternal, sizeof( pxStreamPortRTT->bufferInternal ) );
#else
return TRC_SUCCESS;
#endif
}
traceResult xTraceStreamPortOnEnable( uint32_t uiStartOption )
{
( void ) uiStartOption;
/* Configure the RTT buffers */
SEGGER_RTT_ConfigUpBuffer( TRC_CFG_STREAM_PORT_RTT_UP_BUFFER_INDEX, "TzData", pxStreamPortRTT->bufferUp, sizeof( pxStreamPortRTT->bufferUp ), TRC_CFG_STREAM_PORT_RTT_MODE );
SEGGER_RTT_ConfigDownBuffer( TRC_CFG_STREAM_PORT_RTT_DOWN_BUFFER_INDEX, "TzCtrl", pxStreamPortRTT->bufferDown, sizeof( pxStreamPortRTT->bufferDown ), TRC_CFG_STREAM_PORT_RTT_MODE );
return TRC_SUCCESS;
}
#endif /* if ( TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING ) */
#endif /* if ( TRC_USE_TRACEALYZER_RECORDER == 1 ) */