Mercurial > public > ostc4
comparison Discovery/Src/tInfoLogger.c @ 1033:5f66e44d69f0 Puls_Integration
Added functionality needed for subscription of standard Bluetooth pulse service notifications
| author | Ideenmodellierer |
|---|---|
| date | Sat, 02 Aug 2025 22:42:51 +0200 |
| parents | cd4561c33758 |
| children | 195bfbdf961d |
comparison
equal
deleted
inserted
replaced
| 1032:33b91584d827 | 1033:5f66e44d69f0 |
|---|---|
| 56 { | 56 { |
| 57 uint8_t LogIndex = 0; | 57 uint8_t LogIndex = 0; |
| 58 | 58 |
| 59 if(lineLength <= MAX_CHAR_PER_LINE) | 59 if(lineLength <= MAX_CHAR_PER_LINE) |
| 60 { | 60 { |
| 61 memset(&lines[lineWriteIndex][0],0, (MAX_CHAR_PER_LINE + LINE_HEADER_BYTES)); | |
| 61 if(direction == LOG_TX_LINE) | 62 if(direction == LOG_TX_LINE) |
| 62 { | 63 { |
| 63 lines[lineWriteIndex][LogIndex] = '\002'; /* align right */ | 64 lines[lineWriteIndex][LogIndex] = '\002'; /* align right */ |
| 64 LogIndex++; | 65 LogIndex++; |
| 65 } | 66 } |
| 66 memcpy(&lines[lineWriteIndex][LogIndex],pLine,lineLength); | 67 memcpy(&lines[lineWriteIndex][LogIndex],pLine,lineLength); |
| 67 lines[lineWriteIndex][LogIndex + lineLength] = 0; /* make sure string is zero terminated */ | |
| 68 lineWriteIndex++; | 68 lineWriteIndex++; |
| 69 if(lineWriteIndex == MAX_LOGGER_LINES) | 69 if(lineWriteIndex == MAX_LOGGER_LINES) |
| 70 { | 70 { |
| 71 lineWriteIndex = 0; | 71 lineWriteIndex = 0; |
| 72 } | 72 } |
| 122 else | 122 else |
| 123 { | 123 { |
| 124 displayLine = lineWriteIndex; | 124 displayLine = lineWriteIndex; |
| 125 } | 125 } |
| 126 | 126 |
| 127 if(lineReadIndex != lineWriteIndex) /* needed for isUpdated function */ | |
| 128 { | |
| 129 lineReadIndex++; | |
| 130 if(lineReadIndex == MAX_LOGGER_LINES) | |
| 131 { | |
| 132 lineReadIndex = 0; | |
| 133 } | |
| 134 } | |
| 127 while (index < displayLine) | 135 while (index < displayLine) |
| 128 { | 136 { |
| 129 color = CLUT_Font020; | 137 color = CLUT_Font020; |
| 130 if(lines[index][0] == '\002') | 138 if(lines[index][0] == '\002') |
| 131 { | 139 { |
| 132 color = CLUT_Font021; | 140 color = CLUT_NiceGreen; |
| 133 } | 141 } |
| 134 if(lineReadIndex == lineWriteIndex) | 142 if(lineReadIndex == index) |
| 135 { | 143 { |
| 136 color = CLUT_Font022; | 144 color = CLUT_NiceBlue; |
| 137 } | 145 } |
| 138 tInfo_write_content_simple( 30, 770, 50 + (index * 30), &FontT24, (char*)lines[index], color); | 146 tInfo_write_content_simple( 30, 770, 60 + (index * 30), &FontT24, (char*)lines[index], color); |
| 139 | 147 |
| 140 if(lineReadIndex != lineWriteIndex) /* needed for isUpdated function */ | 148 if(lineReadIndex != lineWriteIndex) /* needed for isUpdated function */ |
| 141 { | 149 { |
| 142 lineReadIndex++; | 150 lineReadIndex++; |
| 143 if(lineReadIndex == MAX_LOGGER_LINES) | 151 if(lineReadIndex == MAX_LOGGER_LINES) |
