-
Notifications
You must be signed in to change notification settings - Fork 177
hal/stepgen: use pins instead of params #1344
Conversation
|
This build has errored out on the runtests. Line 6 in test.hal is the line As these PRs are linked, do you want to close #1345 and #1346 for now until you fix this one? |
|
OK, guess you are busy. When you have sorted #1344, just need to close and reopen #1345 which should queue it for test build again. |
src/hal/components/stepgen.c
Outdated
| if (retval != 0) { return retval; } | ||
| /* export parameter for position scaling */ | ||
| retval = hal_param_float_newf(HAL_RW, &(addr->pos_scale), comp_id, | ||
| retval = hal_pin_float_newf(HAL_IN, &(addr->pos_scale), comp_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be HAL_IO
src/hal/components/stepgen.c
Outdated
| if (retval != 0) { return retval; } | ||
| /* export param for scaled velocity (frequency in Hz) */ | ||
| retval = hal_param_float_newf(HAL_RO, &(addr->freq), comp_id, | ||
| retval = hal_pin_float_newf(HAL_IN, &(addr->freq), comp_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be HAL_OUT
src/hal/components/stepgen.c
Outdated
|
|
||
| /* export param variable for raw counts */ | ||
| retval = hal_param_s32_newf(HAL_RO, &(addr->rawcount), comp_id, | ||
| retval = hal_pin_s32_newf(HAL_IN, &(addr->rawcount), comp_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be HAL_OUT
bd523df to
691cd5d
Compare
|
Let's see if that fixes the problem. |
|
Had to abort that build. It failed in exactly the same way as previously, dumped core and stuck in endless loop after Think the only way forward is to runtests locally and try to find why insmod does not like the module now, by looking at the linuxcnc.log. |
|
A quick run through confirms in a local test Output from linuxcnc.log confirms segfault on loading. A backtrace through the core file will hopefully tell you what it is. |
|
OK think I have it. Line 1160 appears perfectly valid until I noticed that the argv contains step_type set to 2 https://github.com/machinekoder/machinekit/blob/691cd5d6a6fffc871eae0790cbdc9ae0a04223f3/src/hal/components/stepgen.c#L1094 So when it is set to The original had the same line Think if you comment out line 1160 it should work. |
|
In fact it gets worse. The Also the same sloppy assignments to params that didn't exist were made with I now have it running and passing the runtest, by creating the pins irrespective of I'll try to do a PR to your branch for this. |
|
machinekoder#3 done It won't merge as is. but you can see the changes easily enough |
struct stepgen_t contained space for params, but not all were created. Later assignments and comparisons worked even though the param did not exist, because the original hal_xxx_t existed in the struct. When params were converted to pointers to enable real pin creation these shortcuts caused segfaults addressing null pointers Signed-off-by: Mick <arceye@mgware.co.uk>
|
The failures are because of runtests that try to print params, which are now pins; or get more pins than previous, so the result does not match expected. Did not test a full runtests, just the original failure test. I'll adjust the expected output and PR to your branch in a while |
|
machinekoder#4 applies, tests pass locally |
|
no activity on this PR for 6 months, stale, closing |
Params are deprecated (they can't be connected to signals).