小编use*_*807的帖子

vim python 导航到导入的文件

谁是这个问题可能看起来很愚蠢,但我被卡住了。我在一些 python 文件中编写了 gn​​uradio 应用程序。在 VIM 中,我尝试打开一个导入的文件,例如:

from gnuradio import audio
Run Code Online (Sandbox Code Playgroud)

假设我使用该功能:

audio.sink()
Run Code Online (Sandbox Code Playgroud)

在vim中可以快速获取内容

sink()
Run Code Online (Sandbox Code Playgroud)

功能?以 ctags 的命令 CTRL-] 的方式。

Ps 使用 Ctags 导航audio.sink()返回错误:tag not found: sink。使用 Ctags 我只能导航到本地定义(不能导入)。我检查

ctags --list-kinds=python

导入选项已启用。里面的tags文件我看到:

audio   fm_receiver.py  /^from gnuradio import audio$/;"    i
Run Code Online (Sandbox Code Playgroud)

python vim ctags

6
推荐指数
1
解决办法
1649
查看次数

gitlab ci / cd运行器卡住

我已经安装了gitlab omnibus服务器,gitlab-runner和docker的Droplet。尝试配置运行器以在每次推送至master分支时重建并运行docker容器。遵循gitlab的说明:

在此处输入图片说明

我注册了亚军:

$ sudo gitlab-runner register
Runtime platform                                    arch=amd64 os=linux pid=8665 revision=3afdaba6 version=11.5.0
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://example.com/
Please enter the gitlab-ci token for this runner:
ru7i9G9R-3BJn2RXKdtv
Please enter the gitlab-ci description for this runner:
[ubuntu-s-1vcpu-1gb-fra1-01]: warehouse
Please enter the gitlab-ci tags for this runner (comma separated):
warehouse
Registering runner... succeeded                     runner=ru7i9G9R
Please enter the executor: parallels, ssh, virtualbox, docker+machine, kubernetes, docker, docker-ssh, shell, docker-ssh+machine:
docker
Please enter the default Docker image …
Run Code Online (Sandbox Code Playgroud)

docker gitlab-ci-runner docker-compose

5
推荐指数
1
解决办法
2370
查看次数

stm32 printf float变量

我想通过usart从stm32f405注销.在我的syscall.c文件中,我实现了通过usart打印的功能:

int _write(int file, char *ptr, int len)
{
    int todo;
    for (todo = 0; todo < len; todo++)
    {
    usart_send_char( *ptr++ );
    }
    return len;
}
Run Code Online (Sandbox Code Playgroud)

功能usart_send_char( *ptr++ );按预期工作.但是当我打电话时:

printf("%s, %d, %3.2f\r\n", "asd", 777, 13.2 );
Run Code Online (Sandbox Code Playgroud)

我得到: asd, 777, 0.00 浮动变量未正确打印.

Makefile文件:

PROCESSOR = -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16
CFLAGS += $(PROCESSOR) $(INCLUDES) $(STFLAGS) -Wall -fno-strict-aliasing $(C_PROFILE)
LDFLAGS = $(PROCESSOR) -Wl,-Map=$(PROG).map,--cref,--gc-sections
Run Code Online (Sandbox Code Playgroud)

二手compilator:

Sourcery CodeBench Lite 2014.05-28
Run Code Online (Sandbox Code Playgroud)

哪里弄错了?

printf stm32

4
推荐指数
3
解决办法
9703
查看次数

stm32 JTAG 引脚使用

我使用 SWD 在 stm32 芯片中加载固件和调试。它使用 3 个引脚:SWCLK(TCK)SWDIO(TMS)GND

我可以使用其他未在 SWD 接口中使用的 JTAG 引脚:( TDI, TDO, TRST) 用于自己的目的,同时保留在芯片中刷新固件的可能性吗?

stm32 jtag cortex-m

2
推荐指数
1
解决办法
2868
查看次数

Python就像使用Golang处理json一样

使用Python我可以执行以下操作:

r = requests.get(url_base + url)
jsonObj = json.loads(r.content.decode('raw_unicode_escape'))
print(jsonObj["PartDetails"]["ManufacturerPartNumber"]
Run Code Online (Sandbox Code Playgroud)

有没有办法使用Golang执行相同的操作?目前我需要以下:

json.Unmarshal(body, &part_number_json)
fmt.Println("\r\nPartDetails: ", part_number_json.(map[string]interface{})["PartDetails"].(map[string]interface{})["ManufacturerPartNumber"])
Run Code Online (Sandbox Code Playgroud)

也就是说我需要为JSON的每个字段使用强制转换轮胎并使代码不可读.我尝试使用反射,但它也不是很容易.

编辑:目前使用以下功能:

func jso(json interface{}, fields ...string) interface{} {
    res := json
    for _, v := range fields {
        res = res.(map[string]interface{})[v]
    }
    return res
Run Code Online (Sandbox Code Playgroud)

并称之为:

fmt.Println("PartDetails: ", jso( part_number_json, "PartDetails", "ManufacturerPartNumber") )
Run Code Online (Sandbox Code Playgroud)

json go

2
推荐指数
1
解决办法
330
查看次数

Stm32f303免费版

我尝试在 stm32f303 discovery 上运行 freertos。我包括从官方网站下载的 freertos 存档中的所有头文件和源文件。我还包括文件夹中的便携式文件/GCC/ARM_CM4F。我使用 codesourcery lite 编译器。当我尝试编译项目时出现错误:

In file included from freertos/inc/portable.h:321:0,
                 from freertos/inc/FreeRTOS.h:100,
                 from freertos/src/croutine.c:66:
freertos/inc/portmacro.h:167:7: error: missing binary operator before token "long"
Run Code Online (Sandbox Code Playgroud)

portmacro.h的 167-172 字符串:

    #if( configMAX_PRIORITIES > 32 )
        #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32.  It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
    #endif …
Run Code Online (Sandbox Code Playgroud)

gcc stm32 freertos

0
推荐指数
1
解决办法
1597
查看次数

标签 统计

stm32 ×3

cortex-m ×1

ctags ×1

docker ×1

docker-compose ×1

freertos ×1

gcc ×1

gitlab-ci-runner ×1

go ×1

json ×1

jtag ×1

printf ×1

python ×1

vim ×1