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

Channel names #1

Closed
wants to merge 9 commits into from
Closed

Channel names #1

wants to merge 9 commits into from

Conversation

rgrr
Copy link

@rgrr rgrr commented Jan 15, 2023

Hello pico-code,

here is my PR for "channel names from probe".

Don't know, if this is intended: you have tabs in your code. Or is that what the libsigrok guys want?

@rgrr
Copy link
Author

rgrr commented Jan 15, 2023

probe side

example code for the probe side:

            case 'N':
                // return channel name
                // format is N[AD]yy, A=analog, D=digital, yy is channel #
                ret = false;
                if (d->cmdstr_ndx >= 4) {
                    tmpint = atoi(d->cmdstr + 2);
                    if (d->cmdstr[1] == 'A'  &&  tmpint >= 0  &&  tmpint < SR_NUM_A_CHAN) {
                        sprintf(d->rspstr, "ADC%d", tmpint);
                        ret = true;
                    }
                    else if (d->cmdstr[1] == 'D'  &&  tmpint >= 0  &&  tmpint < SR_NUM_D_CHAN) {
                        sprintf(d->rspstr, "GP%d", tmpint + SR_BASE_D_CHAN);
                        ret = true;
                    }
                }
                else if (d->cmdstr[1] == '?') {
                    strcpy(d->rspstr, "ok");
                    ret = true;
                }
                break;

Actually not very complicated ;-)

@pico-coder
Copy link
Owner

sorry for the tardiness. Originally I didn't touch this because I was trying to minimize changes waiting for mainline acceptance.
sigrokproject#256 should have a similar fix to allow channel renaming.

@pico-coder pico-coder closed this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants