| 111 | } |
| 112 | |
| 113 | protected createHmlHelp(th: RTOSCommon.RTOSThreadInfo, thInfo: object) { |
| 114 | if (this.helpHtml === undefined) { |
| 115 | this.helpHtml = ''; |
| 116 | try { |
| 117 | let ret: string = ''; |
| 118 | function strong(s) { |
| 119 | return `<strong>${s}</strong>`; |
| 120 | } |
| 121 | if (!thInfo['uxTCBNumber-val']) { |
| 122 | ret += `Thread ID missing......: Enable macro ${strong('configUSE_TRACE_FACILITY')} in FW<br>`; |
| 123 | } |
| 124 | if (!th.stackInfo.stackEnd) { |
| 125 | ret += `Stack End missing......: Enable macro ${strong('configRECORD_STACK_HIGH_ADDRESS')} in FW<br>`; |
| 126 | } |
| 127 | if ((thInfo['pcTaskName-val'] === '[0]') || (thInfo['pcTaskName-val'] === '[1]')) { |
| 128 | ret += `Thread Name missing....: Set macro ${strong('configMAX_TASK_NAME_LEN')} to something greater than 1 in FW<br>`; |
| 129 | } |
| 130 | |
| 131 | if (!this.ulTotalRunTime) { |
| 132 | ret += /*html*/`<br>Missing Runtime stats..:<br> |
| 133 | /* To get runtime stats, modify the following macro in FreeRTOSConfig.h */<br> |
| 134 | #define ${strong('configGENERATE_RUN_TIME_STATS')} 1 /* 1: generate runtime statistics; 0: no runtime statistics */<br> |
| 135 | /* Also, add the following two macros to provide a high speed counter -- something at least 10x faster than<br> |
| 136 | ** your RTOS scheduler tick. One strategy could be to use a HW counter and sample its current value when needed<br> |
| 137 | */<br> |
| 138 | #define ${strong('portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()')} /* Define this to initialize your timer */<br> |
| 139 | #define ${strong('portGET_RUN_TIME_COUNTER_VALUE()')}${' '.repeat(9)}/* Define this to sample the counter */<br> |
| 140 | `; |
| 141 | } |
| 142 | if (ret) { |
| 143 | ret += '<br>Note: Make sure you consider the performance/resources impact for any changes to your FW.<br>\n'; |
| 144 | ret = '<button class="help-button">Hints to get more out of the FreeRTOS viewer</button>\n' + |
| 145 | `<div class="help"><p>\n${ret}\n</p></div>\n`; |
| 146 | this.helpHtml = ret; |
| 147 | } |
| 148 | } |
| 149 | catch (e) { |
| 150 | console.log(e); |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | private updateCurrentThreadAddr(frameId: number): Promise<void> { |
| 156 | return new Promise<void>((resolve, reject) => { |