Пример #1
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
	/* init hardware interrupt */
	rt_hw_interrupt_init();

	/* init board */
	rt_hw_board_init();

	rt_show_version();

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	/* init timer system */
	rt_system_timer_init();

#ifdef RT_USING_HEAP
#ifdef __CC_ARM
	rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x204000);
#elif __ICCARM__
    rt_system_heap_init(__segment_end("HEAP"), (void*)0x204000);
#else
	rt_system_heap_init((void*)&__bss_end, (void*)0x204000);
#endif
#endif

	/* init scheduler system */
	rt_system_scheduler_init();

#ifdef RT_USING_HOOK /* if the hook is used */
	/* set idle thread hook */
	rt_thread_idle_sethook(rt_hw_led_flash);
#endif

#ifdef RT_USING_DEVICE
	/* init hardware serial device */
	rt_hw_serial_init();
#endif

	/* init application */
	rt_application_init();

#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
	finsh_set_device("uart1");
#endif

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Пример #2
0
/**
 * This function will initial board.
 */
void rt_hw_board_init(void)
{
    /* must call first to configure gpio Alternate functions according the hardware design */
    wm_gpio_config();

    wm_sys_clk_config();

#ifdef RT_USING_HEAP
    rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
#endif

#ifdef RT_USING_COMPONENTS_INIT
    rt_components_board_init();
#endif

#ifdef RT_USING_CONSOLE
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#if TLS_CONFIG_HARD_CRYPTO
    tls_crypto_init();
#endif

    NVIC_SystemLPConfig(NVIC_LP_SLEEPDEEP, ENABLE);
    rt_thread_idle_sethook(_idle_hook_callback);
}
Пример #3
0
void rt_platform_init(void)
{
#ifdef RT_USING_DFS
    /* initialize sd card */
    rt_hw_sdcard_init();

#if defined(RT_USING_MTD_NAND)
    rt_hw_mtd_nand_init();
#endif

#if defined(RT_USING_MTD_NOR)
    sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
#endif

#endif /* RT_USING_DFS */

#ifdef RT_USING_RTGUI
    /* start sdl thread to simulate an LCD */
    rt_hw_sdl_start();
#endif /* RT_USING_RTGUI */

#ifdef _WIN32
    rt_thread_idle_sethook(rt_hw_win32_low_cpu);
#endif
}
Пример #4
0
void apps_init(void)
{

    // init command system.
    commandSystemInit();

    // init ipc objects.
    ipcs_init();

    // init socket_conn array.
    socket_conn_init();

    // init settings stored in flash.
    settings_powerup_init();

    // init lwip, modified by me.
    _lwip_sys_init();

    // init serial devices.
    usart_dev_init();

    // check and start all threads.
    threads_init();

    // init idle hook functions.
    rt_thread_idle_sethook(idle_hook_function);

}
Пример #5
0
/**
 * This function will init QEMU
 *
 */
void rt_hw_board_init(void)
{
	/* initialize 8253 clock to interrupt 1000 times/sec */
	outb(TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT);
	outb(IO_TIMER1, TIMER_DIV(RT_TICK_PER_SECOND) % 256);
	outb(IO_TIMER1, TIMER_DIV(RT_TICK_PER_SECOND) / 256);

	/* install interrupt handler */
	rt_hw_interrupt_install(INTTIMER0, rt_timer_handler, RT_NULL, "tick");
	rt_hw_interrupt_umask(INTTIMER0);

#ifdef RT_USING_HOOK
	rt_thread_idle_sethook(idle_hook);
#endif
}
Пример #6
0
/**
 * This function will initialize beaglebone board
 */
void rt_hw_board_init(void)
{
    /* initialize hardware interrupt */
    rt_hw_interrupt_init();
    /* initialize system heap */
    rt_system_heap_init(HEAP_BEGIN, HEAP_END);

    rt_components_board_init();
    rt_console_set_device(RT_CONSOLE_DEVICE_NAME);

    rt_thread_idle_sethook(idle_wfi);

#ifdef RT_USING_SMP
    /* install IPI handle */
    rt_hw_ipi_handler_install(RT_SCHEDULE_IPI, rt_scheduler_ipi_handler);
#endif
}
Пример #7
0
void cpu_usage_init()
{
	/* set idle thread hook */
	rt_thread_idle_sethook(cpu_usage_idle_hook);
}
Пример #8
0
void sleep_timer_init(void)
{
	_rtc_timer_init();
	rt_thread_idle_sethook(_sleep_entry);
}