You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
p= (volatileSEGGER_RTT_CB*)((char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access control block uncached so that nothing in the cache ever becomes dirty and all changes are visible in HW directly
322
+
p= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access control block uncached so that nothing in the cache ever becomes dirty and all changes are visible in HW directly
323
323
memset((SEGGER_RTT_CB*)p, 0, sizeof(_SEGGER_RTT)); // Make sure that the RTT CB is always zero initialized.
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
584
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRing= (SEGGER_RTT_BUFFER_DOWN*)((char*)&_SEGGER_RTT.aDown[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
676
+
pRing= (SEGGER_RTT_BUFFER_DOWN*)((uintptr_t)&_SEGGER_RTT.aDown[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
// Get "to-host" ring buffer and copy some elements into local variables.
841
841
//
842
842
pData= (constchar*)pBuffer;
843
-
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
843
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
844
844
//
845
845
// Check if we will overwrite data and need to adjust the RdOff.
// It is save to cast that to a "to-host" buffer. Up and Down buffer differ in volatility of offsets that might be modified by J-Link.
1034
1034
//
1035
1035
pData= (constchar*)pBuffer;
1036
-
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aDown[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1036
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aDown[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1110
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1111
1111
//
1112
1112
// How we output depends upon the mode...
1113
1113
//
@@ -1271,7 +1271,7 @@ unsigned SEGGER_RTT_PutCharSkipNoLock(unsigned BufferIndex, char c) {
1271
1271
//
1272
1272
// Get "to-host" ring buffer.
1273
1273
//
1274
-
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1274
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1275
1275
//
1276
1276
// Get write position and handle wrap-around if necessary
1277
1277
//
@@ -1326,7 +1326,7 @@ unsigned SEGGER_RTT_PutCharSkip(unsigned BufferIndex, char c) {
1326
1326
//
1327
1327
// Get "to-host" ring buffer.
1328
1328
//
1329
-
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1329
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1330
1330
//
1331
1331
// Get write position and handle wrap-around if necessary
1332
1332
//
@@ -1385,7 +1385,7 @@ unsigned SEGGER_RTT_PutChar(unsigned BufferIndex, char c) {
1385
1385
//
1386
1386
// Get "to-host" ring buffer.
1387
1387
//
1388
-
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1388
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1389
1389
//
1390
1390
// Get write position and handle wrap-around if necessary
1391
1391
//
@@ -1492,7 +1492,7 @@ int SEGGER_RTT_HasKey(void) {
1492
1492
intr;
1493
1493
1494
1494
INIT();
1495
-
pRing= (SEGGER_RTT_BUFFER_DOWN*)((char*)&_SEGGER_RTT.aDown[0] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1495
+
pRing= (SEGGER_RTT_BUFFER_DOWN*)((uintptr_t)&_SEGGER_RTT.aDown[0] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRing= (SEGGER_RTT_BUFFER_DOWN*)((char*)&_SEGGER_RTT.aDown[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1521
+
pRing= (SEGGER_RTT_BUFFER_DOWN*)((uintptr_t)&_SEGGER_RTT.aDown[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1542
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1573
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1622
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1677
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1678
1678
if (BufferIndex<SEGGER_RTT_MAX_NUM_UP_BUFFERS) {
1679
1679
SEGGER_RTT_LOCK();
1680
1680
pUp=&pRTTCB->aUp[BufferIndex];
@@ -1726,7 +1726,7 @@ int SEGGER_RTT_ConfigDownBuffer(unsigned BufferIndex, const char* sName, void* p
1726
1726
volatileSEGGER_RTT_BUFFER_DOWN*pDown;
1727
1727
1728
1728
INIT();
1729
-
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1729
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1730
1730
if (BufferIndex<SEGGER_RTT_MAX_NUM_DOWN_BUFFERS) {
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1772
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1807
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1808
1808
if (BufferIndex<SEGGER_RTT_MAX_NUM_DOWN_BUFFERS) {
1809
1809
SEGGER_RTT_LOCK();
1810
1810
pDown=&pRTTCB->aDown[BufferIndex];
@@ -1840,7 +1840,7 @@ int SEGGER_RTT_SetFlagsUpBuffer(unsigned BufferIndex, unsigned Flags) {
1840
1840
volatileSEGGER_RTT_BUFFER_UP*pUp;
1841
1841
1842
1842
INIT();
1843
-
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1843
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1844
1844
if (BufferIndex<SEGGER_RTT_MAX_NUM_UP_BUFFERS) {
1845
1845
SEGGER_RTT_LOCK();
1846
1846
pUp=&pRTTCB->aUp[BufferIndex];
@@ -1876,7 +1876,7 @@ int SEGGER_RTT_SetFlagsDownBuffer(unsigned BufferIndex, unsigned Flags) {
1876
1876
volatileSEGGER_RTT_BUFFER_DOWN*pDown;
1877
1877
1878
1878
INIT();
1879
-
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1879
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1880
1880
if (BufferIndex<SEGGER_RTT_MAX_NUM_DOWN_BUFFERS) {
1881
1881
SEGGER_RTT_LOCK();
1882
1882
pDown=&pRTTCB->aDown[BufferIndex];
@@ -1930,7 +1930,7 @@ int SEGGER_RTT_SetTerminal (unsigned char TerminalId) {
1930
1930
ac[0] =0xFFu;
1931
1931
if (TerminalId<sizeof(_aTerminalId)) { // We only support a certain number of channels
1932
1932
ac[1] =_aTerminalId[TerminalId];
1933
-
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[0] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1933
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[0] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1934
1934
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
1935
1935
if ((pRing->Flags&SEGGER_RTT_MODE_MASK) ==SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) {
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[0] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1985
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[0] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
1986
1986
//
1987
1987
// Need to be able to change terminal, write data, change back.
pRing= (SEGGER_RTT_BUFFER_UP*)((char*)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
2062
+
pRing= (SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[BufferIndex] +SEGGER_RTT_UNCACHED_OFF); // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
// Avoid warnings regarding volatile access order. It's not a problem
2087
2087
// in this case, but dampen compiler enthusiasm.
2088
2088
//
2089
-
pRTTCB= (volatileSEGGER_RTT_CB*)((unsigned char*)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
2089
+
pRTTCB= (volatileSEGGER_RTT_CB*)((uintptr_t)&_SEGGER_RTT+SEGGER_RTT_UNCACHED_OFF); // Access RTTCB uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
0 commit comments