#endif #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif #if defined(RT_USING_USER_MAIN) && defined(RT_USING_HEAP) rt_system_heap_init(rt_heap_begin_get(), rt_heap_end_get()); #endif } void SysTick_Handler(void) { ...
/* set console device */ rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif /* RT_USING_CONSOLE */ #ifdef RT_USING_HEAP rt_kprintf("heap: [0x%08x - 0x%08x]\n", (rt_ubase_t) RT_HW_HEAP_BEGIN, (rt_ubase_t) RT_HW_HEAP_END); /* initialize memory system */ rt_system_hea...
rt_hw_pin_init();#endif/*USART driver initialization is openby default*/#ifdef RT_USING_SERIAL rt_hw_usart_init();#endif/*Set the shell console output device*/#ifdef RT_USING_CONSOLE rt_console_set_device(RT_CONSOLE_DEVICE_NAME);#endif/*Board underlying hardwareinitialization*/#ifdef RT_...
#endif #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif #if defined(RT_USING_USER_MAIN) && defined(RT_USING_HEAP) rt_system_heap_init((void*)HEAP_BEGIN, (void*)SRAM_END); #endif } // rtthread tick configuration // 3...
rt_console_set_device("v0_"RT_CONSOLE_DEVICE_NAME); return 0; } INIT_PREV_EXPORT(uart_spooling_init); 将原本的RT_CONSOLE_DEVICE_NAME虚拟为两个串口设备,并设置优先级30,等待1ms让线程运行起来,将控制台设备与v0_uart4绑定(原本与uart4绑定)。
finsh_set_device(RT_CONSOLE_DEVICE_NAME); 设置finsh交互的串口设备 rt_thread_idle_init(); 空线程初始化 rt_system_scheduler_start(); 系统调度器初始化 用户主要关注的几个函数: rt_hw_board_init();电路板上的硬件初始化 rt_application_init();应用程序初始化 ...
finsh_set_device(RT_CONSOLE_DEVICE_NAME);#endif#ifdefRT_USING_LWIP/*initialize lwip stack*//*register ethernetif device*/eth_system_device_init();/*initialize lwip system*/lwip_system_init(); rt_kprintf("TCP/IP initialized!\n");#endif#ifdefRT_USING_DFS/*initialize the device file system*...
将对应的串口驱动名设置到rt_console_set_device()函数中。 shell验证 串口终端可以正常输入输出
{rt_device_t console=rt_console_get_device();//获取到之前设置的终端,即usart1if(console){finsh_set_device(console->parent.name);}}#endifrt_kprintf(FINSH_PROMPT);while(1){ch=finsh_getchar();/* * handle control key * up key : 0x1b 0x5b 0x41 * down key: 0x1b 0x5b 0x42 * ...
(1) 配置 shell 使用串口 1:RT-Thread Kernel —-> Kernel Device Object —-> 修改 the device name for console 为 uart1。 (2) 勾选 Using UART1、Using UART2,选择芯片型号为 STM32F407ZG,时钟源为外部 8MHz,如图所示: 输入命令 scons —target=mdk5 -s 生成 keil 工程,打开工程后先修改 MCU ...