[LinuxCNC/linuxcnc PR#243] uspace: allow calculated parameter array sizes

未分类 bolang 4个月前 (10-15) 27次浏览

Issue #243 | 状态: 已关闭 | 作者: jepler | 创建时间: 2017-03-06


In the original formulation, a use like
~~~~
RTAPIMPARRAY_INT(arr, 3*FOO, “array of three times foo items”);
~~~~
gave a weird error on uspace only when arr= was actually specified on the loadrt commandline. This is because the ‘num’ value was communited to rtapi_app as a string rather than an integer, so the string “3*FOO” was received where a string like “24” was expected, resulting in an error.

Happily we have good test coverage for comp’s use of RTAPIMPARRAY via tests/moduleloading/or2* so even though this was encountered and reported in the non-runtested halppmc driver, we can have confidence about the solution.

Close #242.

Signed-off-by: Jeff Epler


评论 (3)

#1 – jepler 于 2017-03-06

@SebKuzminsky this applies equally to 2.7 and master; and it potentially affects anyone using hal_ppmc in uspace on 2.7. Do you want it in 2.7, or only in master? Like I say in the commit message, we have (thanks to you, I think) good test coverage of this, so I’m fairly confident of the change.


#2 – SebKuzminsky 于 2017-03-06

Looks good for 2.7, thanks @jepler


#3 – SebKuzminsky 于 2017-03-06

This will probably not fix #238 unfortunately, since hm2_7i43.c doesn’t use calculated array sizes for its modparams.


原始Issue: https://github.com/LinuxCNC/linuxcnc/pull/243

喜欢 (0)