Exemplo n.º 1
0
void stellaris_usb0_irq(void)
{
	arm_cm_irq_entry();

	uint status = USBIntStatusControl(USB0_BASE);

	//LTRACEF("usb irq, status 0x%x\n", status);

	if (status & USB_INTCTRL_RESET) {
		// reset
		LTRACEF("reset\n");
		pending_addr_change = false;
		usb_callback(USB_CB_RESET, NULL);
	}
	if (status & USB_INTCTRL_CONNECT) {
		// reset
		LTRACEF("connect\n");
	}

	status = USBIntStatusEndpoint(USB0_BASE);

	if (status & USB_INTEP_0) {
		// ep0
		//LTRACEF("ep0\n");
		ep0_irq();
	}

	arm_cm_irq_exit(true);
}
Exemplo n.º 2
0
Arquivo: debug.c Projeto: DSKIM3/lk
void stellaris_uart0_irq(void)
{
	arm_cm_irq_entry();

	//
	// Get the interrrupt status.
	//
	unsigned long ulStatus = UARTIntStatus(DEBUG_UART, true);

	//
	// Clear the asserted interrupts.
	//
	UARTIntClear(DEBUG_UART, ulStatus);

	//
	// Loop while there are characters in the receive FIFO.
	//
	bool resched = false;
	while (UARTCharsAvail(DEBUG_UART)) {
		//
		// Read the next character from the UART and write it back to the UART.
		//
		unsigned char c = UARTCharGetNonBlocking(DEBUG_UART);
		cbuf_write_char(&debug_rx_buf, c, false);

		resched = true;
	}

	arm_cm_irq_exit(resched);
}
Exemplo n.º 3
0
Arquivo: radio.c Projeto: 0xBADCA7/lk
void ti_cc_rfc_cmd_ack_irq(void) {
	arm_cm_irq_entry();
	HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFACKIFG) = 0;
	event_signal(&ack_evt, false);
	// reschedule if we woke a thread (indicated by !signaled)
	arm_cm_irq_exit(!ack_evt.signaled);
}
Exemplo n.º 4
0
void stm32_USART1_IRQ(void)
{
    bool resched = false;

    arm_cm_irq_entry();

    /* UART parity error interrupt occurred -------------------------------------*/
    if ((__HAL_UART_GET_IT(&handle, UART_IT_PE) != RESET) && (__HAL_UART_GET_IT_SOURCE(&handle, UART_IT_PE) != RESET)) {
        __HAL_UART_CLEAR_PEFLAG(&handle);

        printf("UART PARITY ERROR\n");
    }

    /* UART frame error interrupt occurred --------------------------------------*/
    if ((__HAL_UART_GET_IT(&handle, UART_IT_FE) != RESET) && (__HAL_UART_GET_IT_SOURCE(&handle, UART_IT_ERR) != RESET)) {
        __HAL_UART_CLEAR_FEFLAG(&handle);

        printf("UART FRAME ERROR\n");
    }

    /* UART noise error interrupt occurred --------------------------------------*/
    if ((__HAL_UART_GET_IT(&handle, UART_IT_NE) != RESET) && (__HAL_UART_GET_IT_SOURCE(&handle, UART_IT_ERR) != RESET)) {
        __HAL_UART_CLEAR_NEFLAG(&handle);

        printf("UART NOISE ERROR\n");
    }

    /* UART Over-Run interrupt occurred -----------------------------------------*/
    if ((__HAL_UART_GET_IT(&handle, UART_IT_ORE) != RESET) && (__HAL_UART_GET_IT_SOURCE(&handle, UART_IT_ERR) != RESET)) {
        __HAL_UART_CLEAR_OREFLAG(&handle);

        printf("UART OVERRUN ERROR\n");
    }

    /* UART in mode Receiver ---------------------------------------------------*/
    if ((__HAL_UART_GET_IT(&handle, UART_IT_RXNE) != RESET) && (__HAL_UART_GET_IT_SOURCE(&handle, UART_IT_RXNE) != RESET)) {

        /* we got a character */
        uint8_t c = (uint8_t)(handle.Instance->RDR & 0xff);
        if (cbuf_write_char(&uart1_rx_buf, c, false) != 1) {
            printf("WARNING: uart cbuf overrun!\n");
        }
        resched = true;

        /* Clear RXNE interrupt flag */
        __HAL_UART_SEND_REQ(&handle, UART_RXDATA_FLUSH_REQUEST);
    }

    /* UART in mode Transmitter ------------------------------------------------*/
    if ((__HAL_UART_GET_IT(&handle, UART_IT_TXE) != RESET) &&(__HAL_UART_GET_IT_SOURCE(&handle, UART_IT_TXE) != RESET)) {
        ;
    }

    /* UART in mode Transmitter (transmission end) -----------------------------*/
    if ((__HAL_UART_GET_IT(&handle, UART_IT_TC) != RESET) &&(__HAL_UART_GET_IT_SOURCE(&handle, UART_IT_TC) != RESET)) {
        ;
    }

    arm_cm_irq_exit(resched);
}
Exemplo n.º 5
0
Arquivo: eth.c Projeto: 0xBADCA7/lk
void stm32_ETH_IRQ(void)
{
    arm_cm_irq_entry();

    HAL_ETH_IRQHandler(&eth.EthHandle);

    arm_cm_irq_exit(true);
}
Exemplo n.º 6
0
Arquivo: radio.c Projeto: 0xBADCA7/lk
void ti_cc_rfc_cpe_0_irq(void) {
	arm_cm_irq_entry();
	event_signal(&cpe0_evt, false);

	// disable IRQ until thread handles and re-enables them in response to event
	NVIC_DisableIRQ(rfc_cpe_0_IRQn);

	// reschedule if we woke a thread (indicated by !signaled)
	arm_cm_irq_exit(!cpe0_evt.signaled);
}
Exemplo n.º 7
0
Arquivo: usbc.c Projeto: Gitsyshk/lk
void stm32_USB_IRQ(void)
{
    arm_cm_irq_entry();
    //LTRACE_ENTRY;

    usbc.do_resched = false;
    HAL_PCD_IRQHandler(&usbc.handle);

    arm_cm_irq_exit(usbc.do_resched);
}
Exemplo n.º 8
0
Arquivo: debug.c Projeto: M1cha/lk
void sam3_uart_irq(void)
{
	arm_cm_irq_entry();

	bool resched = false;
	unsigned char c;
	if (uart_read(UART, &c) == 0) {
		cbuf_write_char(&debug_rx_buf, c, false);
		resched = true;
	}

	arm_cm_irq_exit(resched);
}
Exemplo n.º 9
0
/* use systick as the kernel tick */
void _systick(void)
{
	arm_cm_irq_entry();

	ticks++;
	bool resched = false;
	if (cb) {
		lk_time_t now = current_time();
		if (cb(cb_args, now) == INT_RESCHEDULE)
			resched = true;
	}

	arm_cm_irq_exit(resched);
}
Exemplo n.º 10
0
Arquivo: uart.c Projeto: jbush001/lk
void nrf51_UART0_IRQ(void)
{
//  char c;
    arm_cm_irq_entry();
/*
	bool resched = false;
	while ( NRF_UART0->EVENTS_RXDRDY > 0 ) {
        NRF_UART0->EVENTS_RXDRDY = 0;
        c = NRF_UART0->RXD;
		if (!cbuf_space_avail(&uart0_rx_buf)) {
			break;
		}
		cbuf_write_char(&uart0_rx_buf, c, false);
		resched = true;
	}
*/
	arm_cm_irq_exit(false);
}
Exemplo n.º 11
0
Arquivo: debug.c Projeto: 0xBADCA7/lk
void _debugmonitor(void)
{
    u32 n;
    arm_cm_irq_entry();
    n = readl(DCRDR);
    if (n & 0x80000000) {
        switch (n >> 24) {
            case 0x80: // write to console
                __debugger_console_putc(n & 0xFF);
                n = 0;
                break;
            default:
                n = 0x01000000;
        }
        writel(n, DCRDR);
    }
    arm_cm_irq_exit(1);
}
Exemplo n.º 12
0
void nrf51_RADIO_IRQ (void) {

    arm_cm_irq_entry();
    //gpio_set(GPIO_LED1,0);
    if ((NRF_RADIO->INTENSET & RADIO_INTENSET_END_Msk ) && NRF_RADIO->EVENTS_END ) {
        NRF_RADIO->EVENTS_END = 0;
        event_signal(&radio_end_evt, false);
        //gpio_set(GPIO_LED1,1);

    }

    if ((NRF_RADIO->INTENSET & RADIO_INTENSET_DISABLED_Msk ) && NRF_RADIO->EVENTS_DISABLED ) {
        NRF_RADIO->EVENTS_DISABLED = 0;
        event_signal(&radio_disabled_evt, false);
        testvar=NRF_RTC1->COUNTER;
    }

    //gpio_set(GPIO_LED1,1);
    arm_cm_irq_exit(true);
}
Exemplo n.º 13
0
void nrf51_RTC1_IRQ(void)
{
    ticks += tick_increment_us;
    arm_cm_irq_entry();
    bool resched = false;

    if (NRF_RTC1->EVENTS_COMPARE[0] == 1 ) {
        NRF_RTC1->EVENTS_COMPARE[0] = 0;
        NRF_RTC1->CC[0] += tick_increment;

        if (cb) {
            lk_time_t now = current_time();
            if (cb(cb_args, now) == INT_RESCHEDULE)
                resched = true;
        }
    }
    if ((NRF_RTC1->EVENTS_COMPARE[1] == 1) && (NRF_RTC1->INTENSET & RTC_INTENSET_COMPARE1_Msk)) {
        NRF_RTC1->EVENTS_COMPARE[1] = 0;
        NRF_RTC1->INTENCLR  = RTC_INTENSET_COMPARE1_Msk;
        event_signal(cc1_event_p,false);
        resched = true;
    }
    arm_cm_irq_exit(resched);
}
Exemplo n.º 14
0
Arquivo: vectab.c Projeto: 0xBADCA7/lk
/* un-overridden irq handler */
void nrf51_dummy_irq(void)
{
    arm_cm_irq_entry();
    panic("unhandled irq\n");
}
Exemplo n.º 15
0
Arquivo: vectab.c Projeto: DSKIM3/lk
/* un-overridden irq handler */
void stellaris_dummy_irq(void)
{
	arm_cm_irq_entry();

	panic("unhandled irq\n");
}
Exemplo n.º 16
0
Arquivo: radio.c Projeto: 0xBADCA7/lk
void ti_cc_rfc_cpe_1_irq(void) {
	arm_cm_irq_entry();
}