//*****************************************************************************
//
// The callback function for messages from the touch screen driver.
//
//*****************************************************************************
static int32_t
ControlTouchCallback(uint32_t ui32Message, int32_t i32X, int32_t i32Y)
{
    portBASE_TYPE bTaskWaken;

    //
    // Ignore all messages other than pointer down messages.
    //
    if(ui32Message != WIDGET_MSG_PTR_DOWN)
    {
        return(0);
    }

    //
    // Pack the position into a message to send to the spider control task.
    //
    ui32Message = ((i32X & 65535) << 16) | (i32Y & 65535);

    //
    // Send the position message to the spider control task.
    //
    xQueueSendFromISR(g_pControlQueue, &ui32Message, &bTaskWaken);

    //
    // Perform a task yield if necessary.
    //
#if defined(__Check_Later)
    taskYIELD_FROM_ISR(bTaskWaken);
#endif

    //
    // This message has been handled.
    //
    return(0);
}
//*****************************************************************************
//
// The callback function for messages from the touch screen driver.
//
//*****************************************************************************
static long
ControlTouchCallback(unsigned long ulMessage, long lX, long lY)
{
    portBASE_TYPE bTaskWaken;

    //
    // Ignore all messages other than pointer down messages.
    //
    if(ulMessage != WIDGET_MSG_PTR_DOWN)
    {
        return(0);
    }

    //
    // Pack the position into a message to send to the spider control task.
    //
    ulMessage = ((lX & 65535) << 16) | (lY & 65535);

    //
    // Send the position message to the spider control task.
    //
    xQueueSendFromISR(g_pControlQueue, &ulMessage, &bTaskWaken);

    //
    // Perform a task yield if necessary.
    //
    taskYIELD_FROM_ISR(bTaskWaken);

    //
    // This message has been handled.
    //
    return(0);
}
示例#3
0
//*****************************************************************************
//
//! Handles Ethernet interrupts for the lwIP TCP/IP stack.
//!
//! This function handles Ethernet interrupts for the lwIP TCP/IP stack.  At
//! the lowest level, all receive packets are placed into a packet queue for
//! processing at a higher level.  Also, the transmit packet queue is checked
//! and packets are drained and transmitted through the Ethernet MAC as needed.
//! If the system is configured without an RTOS, additional processing is
//! performed at the interrupt level.  The packet queues are processed by the
//! lwIP TCP/IP code, and lwIP periodic timers are serviced (as needed).
//!
//! \return None.
//
//*****************************************************************************
void
lwIPEthernetIntHandler(void)
{
    unsigned long ulStatus;
#if !NO_SYS
    portBASE_TYPE xWake;
#endif

    //
    // Read and Clear the interrupt.
    //
    ulStatus = EthernetIntStatus(ETH_BASE, false);
    EthernetIntClear(ETH_BASE, ulStatus);

    //
    // The handling of the interrupt is different based on the use of a RTOS.
    //
#if NO_SYS
    //
    // No RTOS is being used.  If a transmit/receive interrupt was active,
    // run the low-level interrupt handler.
    //
    if(ulStatus)
    {
        stellarisif_interrupt(&g_sNetIF);
    }

    //
    // Service the lwIP timers.
    //
    lwIPServiceTimers();
#else
    //
    // A RTOS is being used.  Signal the Ethernet interrupt task.
    //
    xQueueSendFromISR(g_pInterrupt, (void *)&ulStatus, &xWake);

    //
    // Disable the Ethernet interrupts.  Since the interrupts have not been
    // handled, they are not asserted.  Once they are handled by the Ethernet
    // interrupt task, it will re-enable the interrupts.
    //
    EthernetIntDisable(ETH_BASE, ETH_INT_RX | ETH_INT_TX);

    //
    // Potentially task switch as a result of the above queue write.
    //
#if RTOS_SAFERTOS
    taskYIELD_FROM_ISR(xWake);
#elif RTOS_FREERTOS
    if(xWake == pdTRUE)
    {
        vPortYieldFromISR();
    }
#endif
#endif
}