lygo
获得 45 次赞
帮助过87人
今天学习cubemx软件上可以直接生成rtos系统的代码,感觉配置一下就出来了,分为什么任务挂起,就绪,等待这些。索性感兴趣就想学习学习,但是听别人说还有ucos系统,不知道这两个哪个更适合初学者学习,或者说上手比较容易?还有还有个liunx系统,不知道哪个学习起来更好,说说大佬们经验,嘻嘻。(尽量不百度,想听听大佬们学习的经验以及经济,谢谢咯)
最近学习nucleo板子,学习到串口的时候发现加上这下面这句话就能实现串口printf打印数据了?百度说是fputc里面的输出指向串口(重定向),这句话不是很理解,望大佬讲解?。还有__GNUC__ 这个在下面起啥作用呢?只知道是GNU 编译器的预定义宏。希望大佬详细的回答下,谢谢!,/* USER CODE BEGIN 1 *#ifdef __GNUC__ /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)#else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)#endif /* __GNUC__ *//** * @brief Retargets the C library printf function to the USART. * @param None * @retval None */PUTCHAR_PROTOTYPE{ /* Place your implementation of fputc here */ /* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */ HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF); return ch;}还有为啥用的是这个HAL_UART_Transmit函数,其他的不能代替吗?