-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pigpiod_if2.c #373
Comments
From just looking at the source you posted, it would seem so. I'll accept a PR if you can test to verify it is indeed broken, fix and retest showing working. Thanks in advance. |
unfortunately I am pretty new to the library so just starting out and finding my way around so I don't have any use case to test with. I was just looking through all the functions and noticed the above. If you see in pigpio.c case PI_CMD_NP: res = gpioNotifyPause(p[1]); break; (line 2199) This can never be called from the remote process because of the mismatch. |
If you plan to write some code requiring this, I can add a patch to the development branch. If all's well then it will get picked up in the next release. |
I think I just decided that since Pause is equivalent to Begin with bits 0 I'd just use Begin. It's the same in the Python. More of an oddity rather than an error. |
Thanks, makes sense. I found another int i2c_process_call(int pi, unsigned handle, unsigned reg, uint32_t val) and int i2c_block_process_call(int pi, unsigned handle, unsigned reg, char *buf, unsigned count) both use PI_CMD_I2CPK and PI_CMD_I2CPC is not used anywhere. I would guess there is similar valid reasoning here too? |
No, that is an error. The code for i2c_process_call should be. int i2c_process_call(int pi, unsigned handle, unsigned reg, uint32_t val)
{
gpioExtent_t ext[1];
/*
p1=handle
p2=reg
p3=4
## extension ##
uint32_t val
*/
ext[0].size = sizeof(uint32_t);
ext[0].ptr = &val;
return pigpio_command_ext
(pi, PI_CMD_I2CPC, handle, reg, 4, 1, ext, 1);
} In this case Python seems to be using the correct call. |
The code here
int notify_pause(int pi, unsigned handle)
{return pigpio_command(pi, PI_CMD_NB, handle, 0, 1);}
Should it not be PI_CMD_NP rather than PI_CMD_NB?
The text was updated successfully, but these errors were encountered: