没有定义" mainSW1_INT_BIT"在使用freeRTOS实时内核PIC32

时间:2014-11-17 11:18:49

标签: real-time semaphore freertos isr pic32

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

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 );
}

请帮忙。

1 个答案:

答案 0 :(得分:1)

如果您拥有该书的合法软拷贝,则源代码随文本一起提供。