Skip to content
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

CM108: unable to trigger default pin setting because I can't see a way to set rig port to CM108 #673

Closed
paulmr opened this issue Apr 23, 2021 · 1 comment
Labels
enhancement needs test Patches have been submitted but need testing to close issue

Comments

@paulmr
Copy link

paulmr commented Apr 23, 2021

In order to correctly trigger the PTT on a modified CM108 chip that has been attached to GPIO3, we need to use ptt_bitnum = 2, which makes sense as a default and it looks like this is the intention of the code:

#  define DEFAULT_CM108_PTT_BITNUM 2
   switch (caps->port_type)
    {
    // [...]
    case RIG_PORT_CM108:
        strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN);
        rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
        rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
        break;

However, this is only triggered if the port_type is set to RIG_PORT_CM108, but I can't see any way to do this:

$ rg RIG_PORT_CM108
include/hamlib/rig.h:    RIG_PORT_CM108,         /*!< CM108 GPIO */
src/iofunc.c:    case RIG_PORT_CM108:
src/rig.c:    case RIG_PORT_CM108:

The enum value seems to be defined but not used anywhere.

It is simple to workaround the issue by explicitly setting the bitnum on the command line:

$ rigctl -L -C ptt_bitnum=2 -P CM108

but the code does seem to suggest that this setting should be the default.

Should a model of the dummy rig be added that sets the port to RIG_PORT_CM108, or is there a place for another rig to be added that has this setting?

@mdblack98 mdblack98 added this to the 4.3 milestone May 24, 2021
@mdblack98 mdblack98 added the needs test Patches have been submitted but need testing to close issue label May 24, 2021
@paulmr
Copy link
Author

paulmr commented Jun 10, 2021

Hello @mdblack98 , I apologise for the delay, but I have now been able to test this with the latest master and it works perfectly. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs test Patches have been submitted but need testing to close issue
Projects
None yet
Development

No branches or pull requests

2 participants