コード例 #1
0
ファイル: 53c810.c プロジェクト: CJBass/mame2013-libretro
void lsi53c810_device::dmaop_interrupt()
{
	if(dcmd & 0x100000) {
		fatalerror("LSI53C810: INTFLY opcode not implemented\n");
	}
	dsps = FETCH();

	istat |= 0x1;   /* DMA interrupt pending */
	dstat |= 0x4;   /* SIR (SCRIPTS Interrupt Instruction Received) */

	if(irq_callback != NULL) {
		irq_callback(machine(), 1);
	}
	dma_icount = 0;
	halted = 1;
}
コード例 #2
0
void Serial_stm32::irq_handler(void)
{
    uint8_t data = 0;

    // Check if we were called because of RXNE
    if (((USART_CR1(config_.device) & USART_CR1_RXNEIE) != 0) &&
            ((USART_SR(config_.device)  & USART_SR_RXNE)    != 0))
    {

        // Retrieve the data from the peripheral
        data = usart_recv(config_.device);
        rx_buffer_.put_lossy(data);

        // Enable transmit interrupt so it sends back the data
        usart_enable_tx_interrupt(config_.device);
    }

    // Check if we were called because of TXE
    if (((USART_CR1(config_.device) & USART_CR1_TXEIE) != 0) &&
            ((USART_SR(config_.device)  & USART_SR_TXE)    != 0))
    {
        if (tx_buffer_.readable() > 0)
        {
            // Get data from output buffer
            tx_buffer_.get(data);

            // Put data into the transmit register
            usart_send(config_.device, data);
        }
        else
        {
            // Disable the TXE interrupt as we don't need it anymore
            usart_disable_tx_interrupt(config_.device);
        }
    }

    // Call callback function if attached
    if (irq_callback != 0)
    {
        irq_callback(this);
    }
}