Question about /opt/pidp10/src/pidp10/src/pdp10/PDP10/ka10_pipanel.c

38 views
Skip to first unread message

Steven A. Falco

unread,
Jun 21, 2024, 12:19:05 PM (8 days ago) Jun 21
to PiDP-10
I'm curious as to why in /opt/pidp10/src/pidp10/src/pdp10/PDP10/ka10_pipanel.c around line 344, we only have 10 columns initialized:

for (col = 0; col < 10; col++) {
gpio_set_fsel(cols[col], GPIO_FSEL_INPUT);
gpio_set_pull(cols[col], PULL_UP);
}

I would expect the upper bound to instead be 18, like so:

for (col = 0; col < 18; col++) {
gpio_set_fsel(cols[col], GPIO_FSEL_INPUT);
gpio_set_pull(cols[col], PULL_UP);
}

I recognize that there are only 10 switches in row 3 and row 4, but there are 18 switches in the other rows, so I'd expect to initialize all 18, especially when someone tries to use the stick/button options or the maintenance panel option.

Is this a typo, or is there a reason not to init all the columns?

Steve

Heinz-Bernd Eggenstein

unread,
Jun 21, 2024, 3:42:46 PM (8 days ago) Jun 21
to PiDP-10
Especially since the corresponding code in the scansw10 test program does put all 18 lines to PULL_UP. Yeah I think you are are onto something ...

Heinz-Bernd Eggenstein

unread,
Jun 21, 2024, 3:52:09 PM (8 days ago) Jun 21
to PiDP-10
And perhaps that is the reason why this still happens to work: scansw10 is executed before the simulation is started to test the initial switch settings fro boot options, and I guess the setting on the pull-up / pull-down resistors for the inputs then stays the way it was set by scansw10. Still a bug IMHO.

HB

Steven A. Falco

unread,
Jun 21, 2024, 3:58:06 PM (8 days ago) Jun 21
to pid...@googlegroups.com
On 6/21/24 03:52 PM, 'Heinz-Bernd Eggenstein' via PiDP-10 wrote:
> And perhaps that is the reason why this still happens to work: scansw10 is executed before the simulation is started to test the initial switch settings fro boot options, and I guess the setting on the pull-up / pull-down resistors for the inputs then stays the way it was set by scansw10. Still a bug IMHO.

That is a good point. I'll submit a fix.

Steve

Reply all
Reply to author
Forward
0 new messages