流程
- 安装MotoPlusIDE
- 配置 VS Code
- 编写代码
- 运行任务>编译 (生成 *.a *.d 文件)
- 生成.out文件
- 拷贝到控制器上(具体操作看手册 可以U盘 也可与网络传输 需要重启)
VS Code 配置
c_cpp_properties.json 配置
{
"configurations": [
{
"name": "Win32",
"includePath": [
"C:\\Program Files (x86)\\Yaskawa\\MotoPlusIDE_DN\\mpbuilder\\inc",
"C:\\Program Files (x86)\\Yaskawa\\MotoPlusIDE_DN\\mpbuilder\\gnu\\4.3.3-vxworks-6.9\\lib\\gcc\\i586-wrs-vxworks\\4.3.3\\include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.10240.0",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
launch.json 配置
{
"version": "0.2.0",
"configurations": [
{
"name": "yrc1000_c",
"type": "cppdbg",
"request": "launch",
// g++ -g 生成的调试用目标文件名
"program": "ccpentium.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
// 输入 gdb 的路径 (有些情况下需要绝对路径)
"miDebuggerPath": "gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
// task.json 中指定的调试目标文件编译命令
// 这样可以在调试前免去手动执行 build-debug 的一步
"preLaunchTask": "build-debug"
}
]
}
settings.json 配置
{
"files.associations": {
"motoplus.h": "c",
"stdio.h": "c",
"stdlib.h": "c",
"mpstopwatch.h": "c",
"mprs232c.h": "c",
"mpsensctrl.h": "c",
"mpsrvoctrl.h": "c",
"mpciodef.h": "c",
"mplegapi00.h": "c",
"mpexfilectrl.h": "c",
"mpsrvofcs.h": "c",
"mpkmcevnt.h": "c",
"mpmempart.h": "c",
"string.h": "c",
"stddef.h": "c",
"mpparams.h": "c",
"winsock2.h": "c",
"time.h": "c",
"limits.h": "c",
"GET_POS.C": "cpp"
},
"C_Cpp.intelliSenseEngineFallback": "Disabled"
}
tasks.json 配置
{
"version": "2.0.0",
"tasks": [
{
"label": "编译",
"type": "shell",
"command": "ccpentium.exe",
"args": [
"-march=atom",
"-nostdlib",
"-fno-builtin",
"-fno-defer-pop",
"-fno-implicit-fp",
"-fno-zero-initialized-in-bss",
"-Wall",
"-Werror-implicit-function-declaration",
"-g",
"-MD",
"-MP",
"-DCPU=_VX_ATOM",
"-DTOOL_FAMILY=gnu",
"-DTOOL=gnu",
"-D_WRS_KERNEL",
"-I",
"${workspaceRoot}",
"-I",
"C:\\Program Files (x86)\\Yaskawa\\MotoPlusIDE_DN\\mpbuilder\\inc",
"-c",
"${file}",
"-o",
"${workspaceRoot}\\myout\\${fileBasenameNoExtension}.a"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "生成out",
"type": "shell",
"command": "ccpentium.exe",
"args": [
"-nostdlib",
"-r",
"-WI",
",-X","-WI",
"~FileList~",
"-o","~OutputPath~"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
将 C:\Program Files (x86)\Yaskawa\MotoPlusIDE_DN 替换为你的安装目录
___