Tracealyzer——追踪中断设置

xTraceSetISRProperties

traceHandle xTraceSetISRProperties(const char* name, uint8_t priority)

Stores a name and priority level for an Interrupt Service Routine, to allow for better visualization. Returns a traceHandle used by

vTraceStoreISRBegin.

Example:


                  #define PRIO_ISR_TIMER1 3 /* the hardware priority level */
                  ...
                  traceHandle Timer1Handle = xTraceSetISRProperties("ISRTimer1", PRIO_ISR_TIMER1);
                  ...
                  void ISR_handler()
                  {
                  vTraceStoreISRBegin(Timer1Handle);
                  ...
                  vTraceStoreISREnd(0);
                  }


VTraceStoreISRBegin

void vTraceStoreISRBegin(traceHandle handle);

Registers the beginning of an Interrupt Service Routine, using a traceHandle provided by xTraceSetISRProperties.

Example:


                  #define PRIO_ISR_TIMER1 3 /* the hardware priority level */
                  ...
                  traceHandle Timer1Handle = xTraceSetISRProperties("ISRTimer1", PRIO_ISR_TIMER1);
                  ...
                  void ISR_handler()
                  {
                  vTraceStoreISRBegin(Timer1Handle);
                  ...
                  vTraceStoreISREnd(0);
                  }VTraceStoreISREnd
void vTraceStoreISREnd(int isTaskSwitchRequired)

Registers the end of an Interrupt Service Routine.

The parameter pendingISR indicates if the interrupt has caused a task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the interrupt is assumed to return to the previous context.

Example:


                  #define PRIO_ISR_TIMER1 3 /* the hardware priority level */
                  ...
                  traceHandle Timer1Handle = xTraceSetISRProperties("ISRTimer1", PRIO_ISR_TIMER1);
                  ...
                  void ISR_handler()
                  {
                  signed BaseType_t xHigherPriorityTaskWoken;
                  vTraceStoreISRBegin(Timer1Handle);
                  /* Wakes up a pending task, causing a task-switch */
                  xSemaphoreGiveFromISR(xSemaphore, &xHigherPriorityTaskWoken);
                  vTraceStoreISREnd(xHigherPriorityTaskWoken);
                  }

猜你喜欢

转载自blog.csdn.net/qingzhuyuxian/article/details/80605164