/*********************************************************************************** Переривання від LCD peripherals ***********************************************************************************/ void LCD_IrqHandler(void) { register unsigned long status= AT91C_BASE_LCDC->LCDC_ISR; AT91C_BASE_LCDC-> LCDC_ICR = status; if ((status & AT91C_LCDC_EOFI) != 0) { unsigned long Addr, BufferSize; if (_PendingBuffer >= 0) { // // Calculate address of the given buffer // BufferSize = (BOARD_LCD_FRAMESIZE_PIXELS) / 8; Addr = (unsigned long)lcd_buf + BufferSize * _PendingBuffer; // // Make the given buffer visible // LCD_BOARD_SetFrameBufferAddress((void *)Addr); // // Send a confirmation that the buffer is visible now // GUI_MULTIBUF_Confirm(_PendingBuffer); _PendingBuffer = -1; } } }
/* VSYNC interrupt handler. Will send confirmation to emWin that frame buffer * addres is changed. Frame buffer address is automatically reloaded during VSYNC. */ void EBI_IRQHandler(void) { uint32_t flags; flags = EBI_IntGet(); EBI_IntClear(flags); if ( flags & EBI_IF_VFPORCH ) { if ( pendingFrameIndex >= 0 ) { /* Send a confirmation that the buffer is visible now */ GUI_MULTIBUF_Confirm(pendingFrameIndex); pendingFrameIndex = -1; } } }
/* VSYNC interrupt handler. This performs the actual flipping * of the buffers. */ void EBI_IRQHandler(void) { uint32_t flags; flags = EBI_IntGet(); EBI_IntClear(flags); if ( flags & EBI_IF_VSYNC ) { if ( pendingFrameIndex >= 0 ) { /* Set Direct Drive frame buffer address to the new frame */ EBI_TFTFrameBaseSet(FRAME_BUFFER_SIZE * pendingFrameIndex); /* Send a confirmation to emWin that the old back buffer is visible now */ GUI_MULTIBUF_Confirm(pendingFrameIndex); /* Reset the pending flag */ pendingFrameIndex = -1; } } }