Fork自 RT-Thread / rt-thread
体验新版 GitCode,发现更多精彩内容 >>
in rt_console_set_device, open new device first and get the new device to _console_device. 我在编写程序时,在device驱动中打印log,但是使用rt_kprintf时,如果_console_device存在非空,那就执行驱动的write函数,但是这是device还没有初始化成功,但是已经提前给_console_device赋值,导致了程序无故fault,以上述修改可避开这样的矛盾。
拖放文件到此处或点击上传