Пример #1
0
void main(void)
{
#ifdef CONFIG_OBJECTS_PRINTK
	printk("Using printk\n");
#endif

#if CONFIG_STATIC_ISR
	IRQ_CONNECT(IRQ_LINE, IRQ_PRIORITY, dummyIsr, NULL, 0);
#endif

#ifdef CONFIG_DYNAMIC_ISR
	/* dynamically link in dummy ISR */
	irq_connect_dynamic(IRQ_LINE, IRQ_PRIORITY, dummyIsr,
		    (void *) 0, 0);
#endif

#ifdef CONFIG_OBJECTS_FIBER
	/* start a trivial fiber */
	task_fiber_start(pStack, FIBER_STACK_SIZE, fiberEntry, (int) MESSAGE,
					 (int) func_array, 10, 0);
#endif

#ifdef CONFIG_OBJECTS_WHILELOOP
	while (1) {
		i++;
	}
#endif
}
Пример #2
0
static void uart_console_init(struct td_device *dev)
{
	struct ns16550_pm_device *pmdev = dev->priv;

	irq_connect_dynamic(pmdev->vector, ISR_DEFAULT_PRIO, uart_rx_isr, 0, 0);
	irq_enable(pmdev->vector);

	/* Enable interrupt */
	SOC_UNMASK_INTERRUPTS(pmdev->uart_int_mask);

	/* Enable IRQ at controller level */
	uart_irq_rx_enable(pmdev->zephyr_device);
	/* allow detecting uart break */
	uart_irq_err_enable(pmdev->zephyr_device);
}
Пример #3
0
/**
 *
 * @brief Entry function for foreground task
 *
 * This routine prints a message, then simply increments a global counter.
 * (Gdb can be used to observe the counter as it increases.)
 *
 * @return N/A
 */
void fgTaskEntry(void)
{
#ifdef TEST_max
	/* dynamically link in dummy ISR */
	irq_connect_dynamic(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr, (void *) 0, 0);
#endif /* TEST_max */

	/* note: referencing "func_array" ensures it isn't optimized out */
#ifdef TEST_max
	printf((char *)MESSAGE, func_array);
#else
	printk((char *)MESSAGE, func_array);
#endif /* TEST_max */

	while (1) {
		i++;
	}
}