2

我正在关注“使用 FreeRTOS 实时内核实用指南 - PIC32 版”。在页面的清单 52 中,没有 mainSW1_INT_BIT 的定义。我很困惑,因为我没有这本书的任何源 zip。代码片段是:

void vSW1_ISR_Handler( void )
{
    portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

    /* 'Give' the semaphore to unblock the task. */
    xSemaphoreGiveFromISR( xBinarySemaphore, &xHigherPriorityTaskWoken );

    /* Clear the software interrupt flag. */
    mainCLEAR_INTERRUPT();

    /* Then clear the interrupt in the interrupt controller. */
    IFS0CLR = mainSW1_INT_BIT;

    /* Giving the semaphore may have unblocked a task - if it did and the
    unblocked task has a priority equal to or above the currently executing
    task then xHigherPriorityTaskWoken will have been set to pdTRUE and
    portEND_SWITCHING_ISR() will force a context switch to the newly unblocked
    higher priority task.
    NOTE: The syntax for forcing a context switch within an ISR varies between
    FreeRTOS ports. The portEND_SWITCHING_ISR() macro is provided as part of
    the PIC32 port layer for this purpose. taskYIELD() must never be called
    from an ISR! */
    portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}

请帮忙。

4

1 回答 1

1

如果您有这本书的合法软拷贝,那么文本中会提供源代码。

于 2014-11-17T15:22:40.253 回答