0
点赞
收藏
分享

微信扫一扫

研发中一些小知识点的积累

Python芸芸 2022-02-20 阅读 72

1、git clone 时指定目录名称

解决方法:git clone 后面增加指定的目录名

git clone https://github.com/RT-Thread-packages/jerryscript.git rtt_jerryscript

效果:这样就把jerryscript clone 到 rtt_jerryscript目录下了

2、git clone 后发现 submodules没有更新过来

解决方法:无须重新clone,使用:git submodule update命令

git submodule update --init --force --recursive

3、cygwin here 右键

需要修改注册表,增加的注册表项,执行的命令如下

C:\cygwin64\bin\mintty.exe -e /bin/bash --login -i -c "cd '%V';exec bash

4、printf的简单实现:可以实现到uart的输出

字符串的格式处理,使用c标准库占用的ROM空间较大,但是简单、功能强大,可以打印浮点。这里使用vsnprintf

#include <stdio.h>

#define DBG_BUFF_MAX_LEN          256

/* debug print : support float double */
int dbg_printf(const char *fmt, ...)
{
    va_list args;
    static char rt_log_buf[DBG_BUFF_MAX_LEN] = { 0 };

    va_start(args, fmt);
    int length = vsnprintf(rt_log_buf, sizeof(rt_log_buf) - 1, fmt, args);

    uart_kputs(rt_log_buf); /* 串口输出 */

    return length;
}

5、清理git 远程的不存在的分支

git remote update --prune
或者
git remote update -p

举报

相关推荐

0 条评论