ext: debug: segger: Updating Segger RTT to 6.32d
Segger RTT update includes alignment of SEGGER_RTT_Conf.h to use KConfig configuration. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
e1ff7cef12
commit
e892ca08f1
5 changed files with 465 additions and 88 deletions
|
@ -53,4 +53,9 @@ config SEGGER_RTT_MODE
|
|||
int
|
||||
default 0 if SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
||||
default 1 if SEGGER_RTT_MODE_NO_BLOCK_TRIM
|
||||
default 2
|
||||
default 2
|
||||
|
||||
config SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
bool "Use a simple byte-loop instead of standard memcpy"
|
||||
|
||||
endif
|
|
@ -1,9 +1,9 @@
|
|||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH & Co. KG *
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 2014 - 2016 SEGGER Microcontroller GmbH & Co. KG *
|
||||
* (c) 1995 - 2018 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
|
@ -31,7 +31,7 @@
|
|||
* disclaimer in the documentation and/or other materials provided *
|
||||
* with the distribution. *
|
||||
* *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH & Co. KG *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH *
|
||||
* nor the names of its contributors may be used to endorse or *
|
||||
* promote products derived from this software without specific *
|
||||
* prior written permission. *
|
||||
|
@ -52,7 +52,7 @@
|
|||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* RTT version: 6.10m *
|
||||
* RTT version: 6.32d *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
|
@ -60,7 +60,7 @@ File : SEGGER_RTT.c
|
|||
Purpose : Implementation of SEGGER real-time transfer (RTT) which
|
||||
allows real-time communication on targets which support
|
||||
debugger memory accesses while the CPU is running.
|
||||
Revision: $Rev: 4351 $
|
||||
Revision: $Rev: 10887 $
|
||||
|
||||
Additional information:
|
||||
Type "int" is assumed to be 32-bits in size
|
||||
|
@ -140,8 +140,16 @@ Additional information:
|
|||
#define STRLEN(a) strlen((a))
|
||||
#endif
|
||||
|
||||
#ifndef MEMCPY
|
||||
#define MEMCPY(pDest, pSrc, NumBytes) memcpy((pDest), (pSrc), (NumBytes))
|
||||
#ifndef SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0
|
||||
#endif
|
||||
|
||||
#ifndef SEGGER_RTT_MEMCPY
|
||||
#ifdef MEMCPY
|
||||
#define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) MEMCPY((pDest), (pSrc), (NumBytes))
|
||||
#else
|
||||
#define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) memcpy((pDest), (pSrc), (NumBytes))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
|
@ -175,7 +183,7 @@ Additional information:
|
|||
#define PRAGMA(A) _Pragma(#A)
|
||||
#define SEGGER_RTT_ALIGN(Var, Alignment) RTT_PRAGMA(data_alignment=Alignment) \
|
||||
Var
|
||||
#elif (defined __CC_ARM__)
|
||||
#elif (defined __CC_ARM)
|
||||
#define SEGGER_RTT_ALIGN(Var, Alignment) Var __attribute__ ((aligned (Alignment)))
|
||||
#else
|
||||
#error "Alignment not supported for this compiler."
|
||||
|
@ -190,7 +198,7 @@ Additional information:
|
|||
#elif (defined __ICCARM__) || (defined __ICCRX__)
|
||||
#define SEGGER_RTT_PUT_SECTION(Var, Section) RTT_PRAGMA(location=Section) \
|
||||
Var
|
||||
#elif (defined __CC_ARM__)
|
||||
#elif (defined __CC_ARM)
|
||||
#define SEGGER_RTT_PUT_SECTION(Var, Section) __attribute__ ((section (Section), zero_init)) Var
|
||||
#else
|
||||
#error "Section placement not supported for this compiler."
|
||||
|
@ -329,6 +337,9 @@ static unsigned _WriteBlocking(SEGGER_RTT_BUFFER_UP* pRing, const char* pBuffer,
|
|||
unsigned NumBytesWritten;
|
||||
unsigned RdOff;
|
||||
unsigned WrOff;
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
char* pDst;
|
||||
#endif
|
||||
//
|
||||
// Write data to buffer and handle wrap-around if necessary
|
||||
//
|
||||
|
@ -343,11 +354,21 @@ static unsigned _WriteBlocking(SEGGER_RTT_BUFFER_UP* pRing, const char* pBuffer,
|
|||
}
|
||||
NumBytesToWrite = MIN(NumBytesToWrite, (pRing->SizeOfBuffer - WrOff)); // Number of bytes that can be written until buffer wrap-around
|
||||
NumBytesToWrite = MIN(NumBytesToWrite, NumBytes);
|
||||
memcpy(pRing->pBuffer + WrOff, pBuffer, NumBytesToWrite);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + WrOff;
|
||||
NumBytesWritten += NumBytesToWrite;
|
||||
NumBytes -= NumBytesToWrite;
|
||||
WrOff += NumBytesToWrite;
|
||||
while (NumBytesToWrite--) {
|
||||
*pDst++ = *pBuffer++;
|
||||
};
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pBuffer, NumBytesToWrite);
|
||||
NumBytesWritten += NumBytesToWrite;
|
||||
pBuffer += NumBytesToWrite;
|
||||
NumBytes -= NumBytesToWrite;
|
||||
WrOff += NumBytesToWrite;
|
||||
#endif
|
||||
if (WrOff == pRing->SizeOfBuffer) {
|
||||
WrOff = 0u;
|
||||
}
|
||||
|
@ -379,6 +400,9 @@ static void _WriteNoCheck(SEGGER_RTT_BUFFER_UP* pRing, const char* pData, unsign
|
|||
unsigned NumBytesAtOnce;
|
||||
unsigned WrOff;
|
||||
unsigned Rem;
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
char* pDst;
|
||||
#endif
|
||||
|
||||
WrOff = pRing->WrOff;
|
||||
Rem = pRing->SizeOfBuffer - WrOff;
|
||||
|
@ -386,17 +410,40 @@ static void _WriteNoCheck(SEGGER_RTT_BUFFER_UP* pRing, const char* pData, unsign
|
|||
//
|
||||
// All data fits before wrap around
|
||||
//
|
||||
memcpy(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + WrOff;
|
||||
WrOff += NumBytes;
|
||||
while (NumBytes--) {
|
||||
*pDst++ = *pData++;
|
||||
};
|
||||
pRing->WrOff = WrOff;
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
pRing->WrOff = WrOff + NumBytes;
|
||||
#endif
|
||||
} else {
|
||||
//
|
||||
// We reach the end of the buffer, so need to wrap around
|
||||
//
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + WrOff;
|
||||
NumBytesAtOnce = Rem;
|
||||
memcpy(pRing->pBuffer + WrOff, pData, NumBytesAtOnce);
|
||||
while (NumBytesAtOnce--) {
|
||||
*pDst++ = *pData++;
|
||||
};
|
||||
pDst = pRing->pBuffer;
|
||||
NumBytesAtOnce = NumBytes - Rem;
|
||||
memcpy(pRing->pBuffer, pData + Rem, NumBytesAtOnce);
|
||||
while (NumBytesAtOnce--) {
|
||||
*pDst++ = *pData++;
|
||||
};
|
||||
pRing->WrOff = NumBytes - Rem;
|
||||
#else
|
||||
NumBytesAtOnce = Rem;
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, NumBytesAtOnce);
|
||||
NumBytesAtOnce = NumBytes - Rem;
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer, pData + Rem, NumBytesAtOnce);
|
||||
pRing->WrOff = NumBytesAtOnce;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,11 +461,11 @@ static void _WriteNoCheck(SEGGER_RTT_BUFFER_UP* pRing, const char* pData, unsign
|
|||
* TerminalId Terminal ID to switch to.
|
||||
*/
|
||||
static void _PostTerminalSwitch(SEGGER_RTT_BUFFER_UP* pRing, unsigned char TerminalId) {
|
||||
char ac[2];
|
||||
unsigned char ac[2];
|
||||
|
||||
ac[0] = 0xFFu;
|
||||
ac[1] = _aTerminalId[TerminalId]; // Caller made already sure that TerminalId does not exceed our terminal limit
|
||||
_WriteBlocking(pRing, ac, 2u);
|
||||
_WriteBlocking(pRing, (const char*)ac, 2u);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -483,6 +530,9 @@ unsigned SEGGER_RTT_ReadNoLock(unsigned BufferIndex, void* pData, unsigned Buffe
|
|||
unsigned WrOff;
|
||||
unsigned char* pBuffer;
|
||||
SEGGER_RTT_BUFFER_DOWN* pRing;
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
const char* pSrc;
|
||||
#endif
|
||||
//
|
||||
INIT();
|
||||
pRing = &_SEGGER_RTT.aDown[BufferIndex];
|
||||
|
@ -496,11 +546,21 @@ unsigned SEGGER_RTT_ReadNoLock(unsigned BufferIndex, void* pData, unsigned Buffe
|
|||
if (RdOff > WrOff) {
|
||||
NumBytesRem = pRing->SizeOfBuffer - RdOff;
|
||||
NumBytesRem = MIN(NumBytesRem, BufferSize);
|
||||
memcpy(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pSrc = pRing->pBuffer + RdOff;
|
||||
NumBytesRead += NumBytesRem;
|
||||
BufferSize -= NumBytesRem;
|
||||
RdOff += NumBytesRem;
|
||||
while (NumBytesRem--) {
|
||||
*pBuffer++ = *pSrc++;
|
||||
};
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
|
||||
NumBytesRead += NumBytesRem;
|
||||
pBuffer += NumBytesRem;
|
||||
BufferSize -= NumBytesRem;
|
||||
RdOff += NumBytesRem;
|
||||
#endif
|
||||
//
|
||||
// Handle wrap-around of buffer
|
||||
//
|
||||
|
@ -514,11 +574,21 @@ unsigned SEGGER_RTT_ReadNoLock(unsigned BufferIndex, void* pData, unsigned Buffe
|
|||
NumBytesRem = WrOff - RdOff;
|
||||
NumBytesRem = MIN(NumBytesRem, BufferSize);
|
||||
if (NumBytesRem > 0u) {
|
||||
memcpy(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pSrc = pRing->pBuffer + RdOff;
|
||||
NumBytesRead += NumBytesRem;
|
||||
BufferSize -= NumBytesRem;
|
||||
RdOff += NumBytesRem;
|
||||
while (NumBytesRem--) {
|
||||
*pBuffer++ = *pSrc++;
|
||||
};
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pBuffer, pRing->pBuffer + RdOff, NumBytesRem);
|
||||
NumBytesRead += NumBytesRem;
|
||||
pBuffer += NumBytesRem;
|
||||
BufferSize -= NumBytesRem;
|
||||
RdOff += NumBytesRem;
|
||||
#endif
|
||||
}
|
||||
if (NumBytesRead) {
|
||||
pRing->RdOff = RdOff;
|
||||
|
@ -586,6 +656,9 @@ void SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuff
|
|||
const char* pData;
|
||||
SEGGER_RTT_BUFFER_UP* pRing;
|
||||
unsigned Avail;
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
char* pDst;
|
||||
#endif
|
||||
|
||||
pData = (const char *)pBuffer;
|
||||
//
|
||||
|
@ -617,26 +690,35 @@ void SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuff
|
|||
//
|
||||
// Last round
|
||||
//
|
||||
#if 1 // memcpy() is good for large amounts of data, but the overhead is too big for small amounts. Use a simple byte loop instead.
|
||||
char* pDst;
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + pRing->WrOff;
|
||||
pRing->WrOff += NumBytes;
|
||||
do {
|
||||
Avail = NumBytes;
|
||||
while (NumBytes--) {
|
||||
*pDst++ = *pData++;
|
||||
} while (--NumBytes);
|
||||
};
|
||||
pRing->WrOff += Avail;
|
||||
#else
|
||||
memcpy(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + pRing->WrOff, pData, NumBytes);
|
||||
pRing->WrOff += NumBytes;
|
||||
#endif
|
||||
break; //Alternatively: NumBytes = 0;
|
||||
break;
|
||||
} else {
|
||||
//
|
||||
// Wrap-around necessary, write until wrap-around and reset WrOff
|
||||
//
|
||||
memcpy(pRing->pBuffer + pRing->WrOff, pData, Avail);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + pRing->WrOff;
|
||||
NumBytes -= Avail;
|
||||
while (Avail--) {
|
||||
*pDst++ = *pData++;
|
||||
};
|
||||
pRing->WrOff = 0;
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + pRing->WrOff, pData, Avail);
|
||||
pData += Avail;
|
||||
pRing->WrOff = 0;
|
||||
NumBytes -= Avail;
|
||||
#endif
|
||||
Avail = (pRing->SizeOfBuffer - 1);
|
||||
}
|
||||
} while (NumBytes);
|
||||
|
@ -673,6 +755,9 @@ unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, u
|
|||
unsigned RdOff;
|
||||
unsigned WrOff;
|
||||
unsigned Rem;
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
char* pDst;
|
||||
#endif
|
||||
|
||||
pData = (const char *)pBuffer;
|
||||
//
|
||||
|
@ -700,16 +785,15 @@ unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, u
|
|||
//
|
||||
Avail = pRing->SizeOfBuffer - 1u - WrOff ;
|
||||
if (Avail >= NumBytes) {
|
||||
#if 1 // memcpy() is good for large amounts of data, but the overhead is too big for small amounts. Use a simple byte loop instead.
|
||||
char* pDst;
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + WrOff;
|
||||
WrOff += NumBytes;
|
||||
do {
|
||||
while (NumBytes--) {
|
||||
*pDst++ = *pData++;
|
||||
} while (--NumBytes);
|
||||
pRing->WrOff = WrOff + NumBytes;
|
||||
};
|
||||
pRing->WrOff = WrOff;
|
||||
#else
|
||||
memcpy(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
pRing->WrOff = WrOff + NumBytes;
|
||||
#endif
|
||||
return 1;
|
||||
|
@ -727,23 +811,55 @@ unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, u
|
|||
//
|
||||
Rem = pRing->SizeOfBuffer - WrOff; // Space until end of buffer
|
||||
if (Rem > NumBytes) {
|
||||
memcpy(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + WrOff;
|
||||
WrOff += NumBytes;
|
||||
while (NumBytes--) {
|
||||
*pDst++ = *pData++;
|
||||
};
|
||||
pRing->WrOff = WrOff;
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
pRing->WrOff = WrOff + NumBytes;
|
||||
#endif
|
||||
} else {
|
||||
//
|
||||
// We reach the end of the buffer, so need to wrap around
|
||||
//
|
||||
memcpy(pRing->pBuffer + WrOff, pData, Rem);
|
||||
memcpy(pRing->pBuffer, pData + Rem, NumBytes - Rem);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + WrOff;
|
||||
NumBytes -= Rem;
|
||||
WrOff = NumBytes;
|
||||
do {
|
||||
*pDst++ = *pData++;
|
||||
} while (--Rem);
|
||||
pDst = pRing->pBuffer;
|
||||
while (NumBytes--) {
|
||||
*pDst++ = *pData++;
|
||||
};
|
||||
pRing->WrOff = WrOff;
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, Rem);
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer, pData + Rem, NumBytes - Rem);
|
||||
pRing->WrOff = NumBytes - Rem;
|
||||
#endif
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
Avail = RdOff - WrOff - 1u;
|
||||
if (Avail >= NumBytes) {
|
||||
memcpy(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
#if SEGGER_RTT_MEMCPY_USE_BYTELOOP
|
||||
pDst = pRing->pBuffer + WrOff;
|
||||
WrOff += NumBytes;
|
||||
while (NumBytes--) {
|
||||
*pDst++ = *pData++;
|
||||
};
|
||||
pRing->WrOff = WrOff;
|
||||
#else
|
||||
SEGGER_RTT_MEMCPY(pRing->pBuffer + WrOff, pData, NumBytes);
|
||||
pRing->WrOff = WrOff + NumBytes;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -771,7 +887,7 @@ unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, u
|
|||
* Number of bytes which have been stored in the "Up"-buffer.
|
||||
*
|
||||
* Notes
|
||||
* (1) If there is not enough space in the "Up"-buffer, remaining characters of pBuffer are dropped.
|
||||
* (1) Data is stored according to buffer flags.
|
||||
* (2) For performance reasons this function does not call Init()
|
||||
* and may only be called after RTT has been initialized.
|
||||
* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
|
||||
|
@ -845,7 +961,7 @@ unsigned SEGGER_RTT_WriteNoLock(unsigned BufferIndex, const void* pBuffer, unsig
|
|||
* Number of bytes which have been stored in the "Up"-buffer.
|
||||
*
|
||||
* Notes
|
||||
* (1) If there is not enough space in the "Up"-buffer, remaining characters of pBuffer are dropped.
|
||||
* (1) Data is stored according to buffer flags.
|
||||
*/
|
||||
unsigned SEGGER_RTT_Write(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
|
||||
unsigned Status;
|
||||
|
@ -880,8 +996,7 @@ unsigned SEGGER_RTT_Write(unsigned BufferIndex, const void* pBuffer, unsigned Nu
|
|||
* Number of bytes which have been stored in the "Up"-buffer.
|
||||
*
|
||||
* Notes
|
||||
* (1) If there is not enough space in the "Up"-buffer, depending on configuration,
|
||||
* remaining characters may be dropped or RTT module waits until there is more space in the buffer.
|
||||
* (1) Data is stored according to buffer flags.
|
||||
* (2) String passed to this function has to be \0 terminated
|
||||
* (3) \0 termination character is *not* stored in RTT buffer
|
||||
*/
|
||||
|
@ -892,6 +1007,178 @@ unsigned SEGGER_RTT_WriteString(unsigned BufferIndex, const char* s) {
|
|||
return SEGGER_RTT_Write(BufferIndex, s, Len);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_RTT_PutCharSkipNoLock
|
||||
*
|
||||
* Function description
|
||||
* Stores a single character/byte in SEGGER RTT buffer.
|
||||
* SEGGER_RTT_PutCharSkipNoLock does not lock the application and
|
||||
* skips the byte, if it does not fit into the buffer.
|
||||
*
|
||||
* Parameters
|
||||
* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
|
||||
* c Byte to be stored.
|
||||
*
|
||||
* Return value
|
||||
* Number of bytes which have been stored in the "Up"-buffer.
|
||||
*
|
||||
* Notes
|
||||
* (1) If there is not enough space in the "Up"-buffer, the character is dropped.
|
||||
* (2) For performance reasons this function does not call Init()
|
||||
* and may only be called after RTT has been initialized.
|
||||
* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
|
||||
*/
|
||||
|
||||
unsigned SEGGER_RTT_PutCharSkipNoLock(unsigned BufferIndex, char c) {
|
||||
SEGGER_RTT_BUFFER_UP* pRing;
|
||||
unsigned WrOff;
|
||||
unsigned Status;
|
||||
//
|
||||
// Get "to-host" ring buffer.
|
||||
//
|
||||
pRing = &_SEGGER_RTT.aUp[BufferIndex];
|
||||
//
|
||||
// Get write position and handle wrap-around if necessary
|
||||
//
|
||||
WrOff = pRing->WrOff + 1;
|
||||
if (WrOff == pRing->SizeOfBuffer) {
|
||||
WrOff = 0;
|
||||
}
|
||||
//
|
||||
// Output byte if free space is available
|
||||
//
|
||||
if (WrOff != pRing->RdOff) {
|
||||
pRing->pBuffer[pRing->WrOff] = c;
|
||||
pRing->WrOff = WrOff;
|
||||
Status = 1;
|
||||
} else {
|
||||
Status = 0;
|
||||
}
|
||||
//
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_RTT_PutCharSkip
|
||||
*
|
||||
* Function description
|
||||
* Stores a single character/byte in SEGGER RTT buffer.
|
||||
*
|
||||
* Parameters
|
||||
* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
|
||||
* c Byte to be stored.
|
||||
*
|
||||
* Return value
|
||||
* Number of bytes which have been stored in the "Up"-buffer.
|
||||
*
|
||||
* Notes
|
||||
* (1) If there is not enough space in the "Up"-buffer, the character is dropped.
|
||||
*/
|
||||
|
||||
unsigned SEGGER_RTT_PutCharSkip(unsigned BufferIndex, char c) {
|
||||
SEGGER_RTT_BUFFER_UP* pRing;
|
||||
unsigned WrOff;
|
||||
unsigned Status;
|
||||
//
|
||||
// Prepare
|
||||
//
|
||||
INIT();
|
||||
SEGGER_RTT_LOCK();
|
||||
//
|
||||
// Get "to-host" ring buffer.
|
||||
//
|
||||
pRing = &_SEGGER_RTT.aUp[BufferIndex];
|
||||
//
|
||||
// Get write position and handle wrap-around if necessary
|
||||
//
|
||||
WrOff = pRing->WrOff + 1;
|
||||
if (WrOff == pRing->SizeOfBuffer) {
|
||||
WrOff = 0;
|
||||
}
|
||||
//
|
||||
// Output byte if free space is available
|
||||
//
|
||||
if (WrOff != pRing->RdOff) {
|
||||
pRing->pBuffer[pRing->WrOff] = c;
|
||||
pRing->WrOff = WrOff;
|
||||
Status = 1;
|
||||
} else {
|
||||
Status = 0;
|
||||
}
|
||||
//
|
||||
// Finish up.
|
||||
//
|
||||
SEGGER_RTT_UNLOCK();
|
||||
//
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_RTT_PutChar
|
||||
*
|
||||
* Function description
|
||||
* Stores a single character/byte in SEGGER RTT buffer.
|
||||
*
|
||||
* Parameters
|
||||
* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
|
||||
* c Byte to be stored.
|
||||
*
|
||||
* Return value
|
||||
* Number of bytes which have been stored in the "Up"-buffer.
|
||||
*
|
||||
* Notes
|
||||
* (1) Data is stored according to buffer flags.
|
||||
*/
|
||||
|
||||
unsigned SEGGER_RTT_PutChar(unsigned BufferIndex, char c) {
|
||||
SEGGER_RTT_BUFFER_UP* pRing;
|
||||
unsigned WrOff;
|
||||
unsigned Status;
|
||||
//
|
||||
// Prepare
|
||||
//
|
||||
INIT();
|
||||
SEGGER_RTT_LOCK();
|
||||
//
|
||||
// Get "to-host" ring buffer.
|
||||
//
|
||||
pRing = &_SEGGER_RTT.aUp[BufferIndex];
|
||||
//
|
||||
// Get write position and handle wrap-around if necessary
|
||||
//
|
||||
WrOff = pRing->WrOff + 1;
|
||||
if (WrOff == pRing->SizeOfBuffer) {
|
||||
WrOff = 0;
|
||||
}
|
||||
//
|
||||
// Wait for free space if mode is set to blocking
|
||||
//
|
||||
if (pRing->Flags == SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) {
|
||||
while (WrOff == pRing->RdOff) {
|
||||
;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Output byte if free space is available
|
||||
//
|
||||
if (WrOff != pRing->RdOff) {
|
||||
pRing->pBuffer[pRing->WrOff] = c;
|
||||
pRing->WrOff = WrOff;
|
||||
Status = 1;
|
||||
} else {
|
||||
Status = 0;
|
||||
}
|
||||
//
|
||||
// Finish up.
|
||||
//
|
||||
SEGGER_RTT_UNLOCK();
|
||||
//
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_RTT_GetKey
|
||||
|
@ -993,6 +1280,27 @@ unsigned SEGGER_RTT_HasData(unsigned BufferIndex) {
|
|||
return v - pRing->RdOff;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_RTT_HasDataUp
|
||||
*
|
||||
* Function description
|
||||
* Check if there is data remaining to be sent in the given buffer.
|
||||
*
|
||||
* Return value:
|
||||
* ==0: No data
|
||||
* !=0: Data in buffer
|
||||
*
|
||||
*/
|
||||
unsigned SEGGER_RTT_HasDataUp(unsigned BufferIndex) {
|
||||
SEGGER_RTT_BUFFER_UP* pRing;
|
||||
unsigned v;
|
||||
|
||||
pRing = &_SEGGER_RTT.aUp[BufferIndex];
|
||||
v = pRing->RdOff;
|
||||
return pRing->WrOff - v;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* SEGGER_RTT_AllocDownBuffer
|
||||
|
@ -1329,7 +1637,7 @@ void SEGGER_RTT_Init (void) {
|
|||
* < 0 Error (e.g. if RTT is configured for non-blocking mode and there was no space in the buffer to set the new terminal Id)
|
||||
*/
|
||||
int SEGGER_RTT_SetTerminal (char TerminalId) {
|
||||
char ac[2];
|
||||
unsigned char ac[2];
|
||||
SEGGER_RTT_BUFFER_UP* pRing;
|
||||
unsigned Avail;
|
||||
int r;
|
||||
|
@ -1337,19 +1645,19 @@ int SEGGER_RTT_SetTerminal (char TerminalId) {
|
|||
INIT();
|
||||
//
|
||||
r = 0;
|
||||
ac[0] = 0xFFU;
|
||||
ac[0] = 0xFFu;
|
||||
if ((unsigned char)TerminalId < (unsigned char)sizeof(_aTerminalId)) { // We only support a certain number of channels
|
||||
ac[1] = _aTerminalId[(unsigned char)TerminalId];
|
||||
pRing = &_SEGGER_RTT.aUp[0]; // Buffer 0 is always reserved for terminal I/O, so we can use index 0 here, fixed
|
||||
SEGGER_RTT_LOCK(); // Lock to make sure that no other task is writing into buffer, while we are and number of free bytes in buffer does not change downwards after checking and before writing
|
||||
if ((pRing->Flags & SEGGER_RTT_MODE_MASK) == SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) {
|
||||
_ActiveTerminal = TerminalId;
|
||||
_WriteBlocking(pRing, ac, 2u);
|
||||
_WriteBlocking(pRing, (const char*)ac, 2u);
|
||||
} else { // Skipping mode or trim mode? => We cannot trim this command so handling is the same for both modes
|
||||
Avail = _GetAvailWriteSpace(pRing);
|
||||
if (Avail >= 2) {
|
||||
_ActiveTerminal = TerminalId; // Only change active terminal in case of success
|
||||
_WriteNoCheck(pRing, ac, 2u);
|
||||
_WriteNoCheck(pRing, (const char*)ac, 2u);
|
||||
} else {
|
||||
r = -1;
|
||||
}
|
||||
|
@ -1397,7 +1705,7 @@ int SEGGER_RTT_TerminalOut (char TerminalId, const char* s) {
|
|||
// Need to be able to change terminal, write data, change back.
|
||||
// Compute the fixed and variable sizes.
|
||||
//
|
||||
FragLen = strlen(s);
|
||||
FragLen = STRLEN(s);
|
||||
//
|
||||
// How we output depends upon the mode...
|
||||
//
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH & Co. KG *
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 2014 - 2016 SEGGER Microcontroller GmbH & Co. KG *
|
||||
* (c) 1995 - 2018 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
|
@ -31,7 +31,7 @@
|
|||
* disclaimer in the documentation and/or other materials provided *
|
||||
* with the distribution. *
|
||||
* *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH & Co. KG *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH *
|
||||
* nor the names of its contributors may be used to endorse or *
|
||||
* promote products derived from this software without specific *
|
||||
* prior written permission. *
|
||||
|
@ -52,7 +52,7 @@
|
|||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* RTT version: 6.10m *
|
||||
* RTT version: 6.32d *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
|
@ -60,7 +60,7 @@ File : SEGGER_RTT.h
|
|||
Purpose : Implementation of SEGGER real-time transfer which allows
|
||||
real-time communication on targets which support debugger
|
||||
memory accesses while the CPU is running.
|
||||
Revision: $Rev: 4351 $
|
||||
Revision: $Rev: 10533 $
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -146,6 +146,7 @@ int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const cha
|
|||
int SEGGER_RTT_GetKey (void);
|
||||
unsigned SEGGER_RTT_HasData (unsigned BufferIndex);
|
||||
int SEGGER_RTT_HasKey (void);
|
||||
unsigned SEGGER_RTT_HasDataUp (unsigned BufferIndex);
|
||||
void SEGGER_RTT_Init (void);
|
||||
unsigned SEGGER_RTT_Read (unsigned BufferIndex, void* pBuffer, unsigned BufferSize);
|
||||
unsigned SEGGER_RTT_ReadNoLock (unsigned BufferIndex, void* pData, unsigned BufferSize);
|
||||
|
@ -159,6 +160,9 @@ unsigned SEGGER_RTT_WriteNoLock (unsigned BufferIndex, const voi
|
|||
unsigned SEGGER_RTT_WriteSkipNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
|
||||
unsigned SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s);
|
||||
void SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
|
||||
unsigned SEGGER_RTT_PutChar (unsigned BufferIndex, char c);
|
||||
unsigned SEGGER_RTT_PutCharSkip (unsigned BufferIndex, char c);
|
||||
unsigned SEGGER_RTT_PutCharSkipNoLock (unsigned BufferIndex, char c);
|
||||
//
|
||||
// Function macro for performance optimization
|
||||
//
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH & Co. KG *
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 2014 - 2016 SEGGER Microcontroller GmbH & Co. KG *
|
||||
* (c) 1995 - 2018 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
|
@ -31,7 +31,7 @@
|
|||
* disclaimer in the documentation and/or other materials provided *
|
||||
* with the distribution. *
|
||||
* *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH & Co. KG *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH *
|
||||
* nor the names of its contributors may be used to endorse or *
|
||||
* promote products derived from this software without specific *
|
||||
* prior written permission. *
|
||||
|
@ -52,16 +52,16 @@
|
|||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* RTT version: 6.10m *
|
||||
* RTT version: 6.32d *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
File : SEGGER_RTT_Conf.h
|
||||
Purpose : Implementation of SEGGER real-time transfer (RTT) which
|
||||
allows real-time communication on targets which support
|
||||
Purpose : Implementation of SEGGER real-time transfer (RTT) which
|
||||
allows real-time communication on targets which support
|
||||
debugger memory accesses while the CPU is running.
|
||||
Revision: $Rev: 4351 $
|
||||
----------------------------------------------------------------------
|
||||
Revision: $Rev: 9599 $
|
||||
|
||||
*/
|
||||
|
||||
#ifndef SEGGER_RTT_CONF_H
|
||||
|
@ -78,7 +78,6 @@ Revision: $Rev: 4351 $
|
|||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
#define SEGGER_RTT_MAX_NUM_UP_BUFFERS CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS // Max. number of up-buffers (T->H) available on this target (Default: 3)
|
||||
#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS CONFIG_SEGGER_RTT_MAX_NUM_DOWN_BUFFERS // Max. number of down-buffers (H->T) available on this target (Default: 3)
|
||||
|
||||
|
@ -88,19 +87,39 @@ Revision: $Rev: 4351 $
|
|||
#define SEGGER_RTT_PRINTF_BUFFER_SIZE CONFIG_SEGGER_RTT_PRINTF_BUFFER_SIZE // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)
|
||||
|
||||
// Mode for pre-initialized terminal channel (buffer 0)
|
||||
#if defined(CONFIG_SEGGER_RTT_MODE_NO_BLOCK_SKIP)
|
||||
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP
|
||||
#elif defined(CONFIG_SEGGER_RTT_MODE_NO_BLOCK_TRIM)
|
||||
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_TRIM
|
||||
#elif defined(CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL)
|
||||
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
||||
#define SEGGER_RTT_MODE_DEFAULT CONFIG_SEGGER_RTT_MODE
|
||||
|
||||
#define USE_RTT_ASM (0) // Use assembler version of SEGGER_RTT.c when 1
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* RTT memcpy configuration
|
||||
*
|
||||
* memcpy() is good for large amounts of data,
|
||||
* but the overhead is big for small amounts, which are usually stored via RTT.
|
||||
* With SEGGER_RTT_MEMCPY_USE_BYTELOOP a simple byte loop can be used instead.
|
||||
*
|
||||
* SEGGER_RTT_MEMCPY() can be used to replace standard memcpy() in RTT functions.
|
||||
* This is may be required with memory access restrictions,
|
||||
* such as on Cortex-A devices with MMU.
|
||||
*/
|
||||
#if defined(CONFIG_SEGGER_RTT_MEMCPY_USE_BYTELOOP)
|
||||
#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 1 // 1: Use a simple byte-loop
|
||||
else
|
||||
#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0 // 0: Use memcpy/SEGGER_RTT_MEMCPY
|
||||
#endif
|
||||
//
|
||||
// Example definition of SEGGER_RTT_MEMCPY to external memcpy with GCC toolchains and Cortex-A targets
|
||||
//
|
||||
//#if ((defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)) && (defined (__ARM_ARCH_7A__))
|
||||
// #define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) SEGGER_memcpy((pDest), (pSrc), (NumBytes))
|
||||
//#endif
|
||||
|
||||
//
|
||||
// Target is not allowed to perform other RTT operations while string still has not been stored completely.
|
||||
// Otherwise we would probably end up with a mixed string in the buffer.
|
||||
// If using RTT from within interrupts, multiple tasks or multi processors, define the SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() function here.
|
||||
//
|
||||
//
|
||||
// SEGGER_RTT_MAX_INTERRUPT_PRIORITY can be used in the sample lock routines on Cortex-M3/4.
|
||||
// Make sure to mask all interrupts which can send RTT data, i.e. generate SystemView events, or cause task switches.
|
||||
// When high-priority interrupts must not be masked while sending RTT data, SEGGER_RTT_MAX_INTERRUPT_PRIORITY needs to be adjusted accordingly.
|
||||
|
@ -109,13 +128,13 @@ Revision: $Rev: 4351 $
|
|||
// Default configuration in FreeRTOS: configMAX_SYSCALL_INTERRUPT_PRIORITY: ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
// In case of doubt mask all interrupts: 1 << (8 - BASEPRI_PRIO_BITS) i.e. 1 << 5 when 3 bits are implemented in NVIC
|
||||
// or define SEGGER_RTT_LOCK() to completely disable interrupts.
|
||||
//
|
||||
//
|
||||
|
||||
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) // Interrupt priority to lock on SEGGER_RTT_LOCK on Cortex-M3/4 (Default: 0x20)
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* RTT lock configuration for SEGGER Embedded Studio,
|
||||
* RTT lock configuration for SEGGER Embedded Studio,
|
||||
* Rowley CrossStudio and GCC
|
||||
*/
|
||||
#if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)
|
||||
|
@ -128,15 +147,15 @@ Revision: $Rev: 4351 $
|
|||
: "=r" (LockState) \
|
||||
: \
|
||||
: "r1" \
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() __asm volatile ("msr primask, %0 \n\t" \
|
||||
: \
|
||||
: "r" (LockState) \
|
||||
: \
|
||||
); \
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__))
|
||||
#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
|
||||
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
|
||||
|
@ -149,15 +168,15 @@ Revision: $Rev: 4351 $
|
|||
: "=r" (LockState) \
|
||||
: "i"(SEGGER_RTT_MAX_INTERRUPT_PRIORITY) \
|
||||
: "r1" \
|
||||
);
|
||||
|
||||
);
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() __asm volatile ("msr basepri, %0 \n\t" \
|
||||
: \
|
||||
: "r" (LockState) \
|
||||
: \
|
||||
); \
|
||||
}
|
||||
|
||||
|
||||
#elif defined(__ARM_ARCH_7A__)
|
||||
#define SEGGER_RTT_LOCK() { \
|
||||
unsigned int LockState; \
|
||||
|
@ -182,7 +201,7 @@ Revision: $Rev: 4351 $
|
|||
); \
|
||||
}
|
||||
#else
|
||||
#define SEGGER_RTT_LOCK()
|
||||
#define SEGGER_RTT_LOCK()
|
||||
#define SEGGER_RTT_UNLOCK()
|
||||
#endif
|
||||
#endif
|
||||
|
@ -196,8 +215,8 @@ Revision: $Rev: 4351 $
|
|||
#define SEGGER_RTT_LOCK() { \
|
||||
unsigned int LockState; \
|
||||
LockState = __get_PRIMASK(); \
|
||||
__set_PRIMASK(1);
|
||||
|
||||
__set_PRIMASK(1);
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() __set_PRIMASK(LockState); \
|
||||
}
|
||||
#elif ((defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)) || (defined (__ARM7M__) && (__CORE__ == __ARM7M__)))
|
||||
|
@ -207,10 +226,10 @@ Revision: $Rev: 4351 $
|
|||
#define SEGGER_RTT_LOCK() { \
|
||||
unsigned int LockState; \
|
||||
LockState = __get_BASEPRI(); \
|
||||
__set_BASEPRI(SEGGER_RTT_MAX_INTERRUPT_PRIORITY);
|
||||
|
||||
__set_BASEPRI(SEGGER_RTT_MAX_INTERRUPT_PRIORITY);
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() __set_BASEPRI(LockState); \
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -222,8 +241,22 @@ Revision: $Rev: 4351 $
|
|||
#define SEGGER_RTT_LOCK() { \
|
||||
unsigned long LockState; \
|
||||
LockState = __get_interrupt_state(); \
|
||||
__disable_interrupt();
|
||||
|
||||
__disable_interrupt();
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() __set_interrupt_state(LockState); \
|
||||
}
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* RTT lock configuration for IAR RL78
|
||||
*/
|
||||
#ifdef __ICCRL78__
|
||||
#define SEGGER_RTT_LOCK() { \
|
||||
__istate_t LockState; \
|
||||
LockState = __get_interrupt_state(); \
|
||||
__disable_interrupt();
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() __set_interrupt_state(LockState); \
|
||||
}
|
||||
#endif
|
||||
|
@ -261,6 +294,33 @@ Revision: $Rev: 4351 $
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* RTT lock configuration for TI ARM
|
||||
*/
|
||||
#ifdef __TI_ARM__
|
||||
#if defined (__TI_ARM_V6M0__)
|
||||
#define SEGGER_RTT_LOCK() { \
|
||||
unsigned int LockState; \
|
||||
LockState = __get_PRIMASK(); \
|
||||
__set_PRIMASK(1);
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() __set_PRIMASK(LockState); \
|
||||
}
|
||||
#elif (defined (__TI_ARM_V7M3__) || defined (__TI_ARM_V7M4__))
|
||||
#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
|
||||
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
|
||||
#endif
|
||||
#define SEGGER_RTT_LOCK() { \
|
||||
unsigned int LockState; \
|
||||
LockState = OS_GetBASEPRI(); \
|
||||
OS_SetBASEPRI(SEGGER_RTT_MAX_INTERRUPT_PRIORITY);
|
||||
|
||||
#define SEGGER_RTT_UNLOCK() OS_SetBASEPRI(LockState); \
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* RTT lock configuration fallback
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH & Co. KG *
|
||||
* SEGGER Microcontroller GmbH *
|
||||
* The Embedded Experts *
|
||||
**********************************************************************
|
||||
* *
|
||||
* (c) 2014 - 2016 SEGGER Microcontroller GmbH & Co. KG *
|
||||
* (c) 1995 - 2018 SEGGER Microcontroller GmbH *
|
||||
* *
|
||||
* www.segger.com Support: support@segger.com *
|
||||
* *
|
||||
|
@ -31,7 +31,7 @@
|
|||
* disclaimer in the documentation and/or other materials provided *
|
||||
* with the distribution. *
|
||||
* *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH & Co. KG *
|
||||
* o Neither the name of SEGGER Microcontroller GmbH *
|
||||
* nor the names of its contributors may be used to endorse or *
|
||||
* promote products derived from this software without specific *
|
||||
* prior written permission. *
|
||||
|
@ -52,13 +52,13 @@
|
|||
* *
|
||||
**********************************************************************
|
||||
* *
|
||||
* RTT version: 6.10m *
|
||||
* RTT version: 6.32d *
|
||||
* *
|
||||
**********************************************************************
|
||||
---------------------------END-OF-HEADER------------------------------
|
||||
File : SEGGER_RTT_printf.c
|
||||
Purpose : Replacement for printf to write formatted data via RTT
|
||||
Revision: $Rev: 4351 $
|
||||
Revision: $Rev: 9599 $
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
#include "SEGGER_RTT.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue