这些是关键功能,因为归位模块必须能够读取和写入引脚。 错误是: rod@penguin:~$ halcompile --compile ciahome.comp Compiling realtime ciahome.c ciahome.comp: In function ‘write_homing_out_pins’: ciahome.comp:287:33: error: ‘H’ undeclared (first use in this function) ciahome.comp:287:33: note: each undeclared identifier is reported only once for each function it appears in ciahome.comp: In function ‘read_homing_in_pins’: ciahome.comp:304:9: error: ‘H’ undeclared (first use in this function) make: *** [/home/rod/linuxcnc-dev/src/Makefile.modinc:115: ciahome.o] Error 1]
我正在编写一个自定义归位模块,用于归位 cia402 ethercat 驱动器以使用其内部归位功能。编译这些函数的精确副本时出现此错误:
这些是关键功能,因为归位模块必须能够读取和写入引脚。
错误是:
rod@penguin:~$ halcompile --compile ciahome.comp Compiling realtime ciahome.c ciahome.comp: In function ‘write_homing_out_pins’: ciahome.comp:287:33: error: ‘H’ undeclared (first use in this function) ciahome.comp:287:33: note: each undeclared identifier is reported only once for each function it appears in ciahome.comp: In function ‘read_homing_in_pins’: ciahome.comp:304:9: error: ‘H’ undeclared (first use in this function) make: *** [/home/rod/linuxcnc-dev/src/Makefile.modinc:115: ciahome.o] Error 1]该错误与采用以下形式的行有关:
*(addr->homing) = H[jno].homing; // OUT H[jno].index_enable = *(addr->index_enable); // IO我在 homing.c 中添加了所有包含文件,但这并没有解决错误。
#include "motion.h" #include "homing.h" #include "hal.h" #include "rtapi.h" #include "rtapi_math.h"我不知道 H 在哪里声明或者它是否是某种编译器指令
我只能假设构建环境在 halcompile 中是不同的
可以将此问题的解决方法添加到 homecomp 环境中