Some time ago I used SystemView from SEGGER and made some code for it to support the ChibiOS.
Now this code do not compile because I used the member "prio" from struct "ch_thread". But now there is no it.
The code for SystemView was:
Code: Select all
/**
* @brief Context switch hook.
* @details This hook is invoked just before switching between threads.
*/
#if SYSVIEW_ENABLE == 1
#if SYSVIEW_CFG_HIDE_IDLE == TRUE
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
/* Context switch code here.*/ \
if (otp->prio != IDLEPRIO) \
{ \
SEGGER_SYSVIEW_OnTaskStopExec(); \
} \
if (ntp->prio == IDLEPRIO) \
{ \
SEGGER_SYSVIEW_OnIdle(); \
} else \
{ \
SEGGER_SYSVIEW_OnTaskStartExec((unsigned)ntp); \
} \
}
#else
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
/* Context switch code here.*/ \
SEGGER_SYSVIEW_OnTaskStopExec(); \
SEGGER_SYSVIEW_OnTaskStartExec((unsigned)ntp); \
}
#endif
In this hook we decied what kind of the CONTEXT switch was heppen and call the desired functions from SystemView for that.
and else
Code: Select all
/* Scanning registry.*/
syssts_t sts = chSysGetStatusAndLockX();
ctp = ch.rlist.newer;
chSysRestoreStatusX(sts);
do {
/* Exclude IDLE THREAD from list */
#if SYSVIEW_CFG_HIDE_IDLE == TRUE
if (ctp->prio != IDLEPRIO)
#endif
{
In this code we produce the list of all threads exclude idle thread.
Please help. How can I implement this code in new version of the ChibiOS? In older versions it work very well and was very helpfull.