PiDP-8/I Software

Check-in [ccedb853c9]
Log In

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:revert pinctrl chaching optim., not worth it. Moved ILS/NLS switching logic from compile time to runtime / configuration file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | pi5-ils2-bookworm
Files: files | file ages | folders
SHA1: ccedb853c90ac901b26c70cc2e89838bb56a4990
User & Date: HBEggenstein 2024-06-14 23:42:21
Context
2024-06-15
21:58
merge Steve Tockey's branch cycle-realistic into the pi5-ils2-bookworm branch check-in: d413ed639f user: HBEggenstein tags: pi5-ils2-bworm-cyclerealistic
16:29
Unconditionally install pidp8i.rc check-in: 1d0f9ffd4d user: poetnerd tags: pi5-ils2-bookworm
2024-06-14
23:42
revert pinctrl chaching optim., not worth it. Moved ILS/NLS switching logic from compile time to runtime / configuration file check-in: ccedb853c9 user: HBEggenstein tags: pi5-ils2-bookworm
2024-06-09
20:59
Fix for scanswitch as per email on 5/19. Otherwise pidp8i won't start from systemd. check-in: 3a1f169d7d user: poetnerd tags: pi5-ils2-bookworm
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.in.

469
470
471
472
473
474
475


476
477
478
479
480
481
482
	@ln -f $(DESTDIR)$(PREFIX)/bin/ptp2txt $(DESTDIR)$(PREFIX)/bin/txt2ptp
	@(	test -e $(DESTDIR)@MEDIADIR@/os8/os8.rk05 || \
		test -e $(DESTDIR)@MEDIADIR@/os8/os8v3d-bin.rk05 || \
		test -e $(DESTDIR)@MEDIADIR@/os8/v3d.rk05) && \
		echo "Skipping media image and SIMH boot script reinstall." || \
		$(MAKE) mediainstall
	@ln -f $(DESTDIR)$(PREFIX)/bin/pidp8i-sim $(DESTDIR)$(PREFIX)/bin/pdp8  # run w/o PiDP-8/I extensions



	@# Install CC8 stuff if built
	@test -n "@CC8_CROSS@" && \
		echo "Installing cc8 cross-compiler..." ; \
		@INSTALL@ -m 755 bin/cc8 $(DESTDIR)$(PREFIX)/bin && \
		@INSTALL@ -m 644 @srcdir@/src/cc8/include/* $(DESTDIR)$(PREFIX)/share/include








>
>







469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
	@ln -f $(DESTDIR)$(PREFIX)/bin/ptp2txt $(DESTDIR)$(PREFIX)/bin/txt2ptp
	@(	test -e $(DESTDIR)@MEDIADIR@/os8/os8.rk05 || \
		test -e $(DESTDIR)@MEDIADIR@/os8/os8v3d-bin.rk05 || \
		test -e $(DESTDIR)@MEDIADIR@/os8/v3d.rk05) && \
		echo "Skipping media image and SIMH boot script reinstall." || \
		$(MAKE) mediainstall
	@ln -f $(DESTDIR)$(PREFIX)/bin/pidp8i-sim $(DESTDIR)$(PREFIX)/bin/pdp8  # run w/o PiDP-8/I extensions
	@ln -f $(DESTDIR)$(PREFIX)/bin/pidp8i-sim $(DESTDIR)$(PREFIX)/bin/pidp8i-sim-nls  # run with forced NLS mode
	@ln -f $(DESTDIR)$(PREFIX)/bin/pidp8i-sim $(DESTDIR)$(PREFIX)/bin/pidp8i-sim-ils  # run with forced ILS mode

	@# Install CC8 stuff if built
	@test -n "@CC8_CROSS@" && \
		echo "Installing cc8 cross-compiler..." ; \
		@INSTALL@ -m 755 bin/cc8 $(DESTDIR)$(PREFIX)/bin && \
		@INSTALL@ -m 644 @srcdir@/src/cc8/include/* $(DESTDIR)$(PREFIX)/share/include

901
902
903
904
905
906
907


908
909
910
911
912
913
914

$(BUILDDIRS):
	mkdir -p $@

$(PIDP8I_SIM): $(SIM_OBJS) $(GPIO_OBJS)  $(PIDP8I_OBJS) $(LED_OBJ)
	$(CC) -o $@ $^ $(LIBS) $(SIM_LFLAGS)
	ln -f bin/pidp8i-sim bin/pdp8



bin/cc8: $(CC8_OBJS)
	$(CC) $(CC8_CROSS_CFLAGS) -o $@ $^ $(LIBS)

bin/d8tape: $(D8TAPE_OBJS)
	$(CC) $(D8TAPE_CFLAGS) -o $@ $^








>
>







903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918

$(BUILDDIRS):
	mkdir -p $@

$(PIDP8I_SIM): $(SIM_OBJS) $(GPIO_OBJS)  $(PIDP8I_OBJS) $(LED_OBJ)
	$(CC) -o $@ $^ $(LIBS) $(SIM_LFLAGS)
	ln -f bin/pidp8i-sim bin/pdp8
	ln -f bin/pidp8i-sim bin/pidp8i-sim-nls
	ln -f bin/pidp8i-sim bin/pidp8i-sim-ils

bin/cc8: $(CC8_OBJS)
	$(CC) $(CC8_CROSS_CFLAGS) -o $@ $^ $(LIBS)

bin/d8tape: $(D8TAPE_OBJS)
	$(CC) $(D8TAPE_CFLAGS) -o $@ $^

Changes to auto.def.

310
311
312
313
314
315
316
317
318
319
320
321

322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
    file delete -force bin/v3d-dist.rk05
    msg-result "os8 options changed; will rebuild OS/8 disk images."
}

# High-level definitions
set builddir [get-define builddir]
set srcdir [get-define srcdir]
set cores [exec $srcdir/tools/corecount]

# Translate --throttle value to a SIMH command
set tv [opt-val throttle]
set tvsl [string length $tv]

if {($tvsl == 0 && $cores > 1) || $tv == "none"} {
    define SET_THROTTLE {set nothrottle}
    set tv "unlimited"
} else {
    # Rewrite symbolic values with values SIMH can understand.  See
    # README-throttle.md for the justification of these values.
    if {$tv == "single-core" || $tvsl == 0} {
        # It's a single-core Pi board, so just tell SIMH to take half
        # the host CPU power, leaving the rest left for background
        # tasks.  We can't use an IPS value here for several reasons.
        # See README-throttle.md for details.
        set tv "50%"
    } elseif {$tv == "pdp8e"} {
        set tv "416k"
    } elseif {$tv == "pdp8i" || $tv == "pdp8a"} {







<




>
|





|
|







310
311
312
313
314
315
316

317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
    file delete -force bin/v3d-dist.rk05
    msg-result "os8 options changed; will rebuild OS/8 disk images."
}

# High-level definitions
set builddir [get-define builddir]
set srcdir [get-define srcdir]


# Translate --throttle value to a SIMH command
set tv [opt-val throttle]
set tvsl [string length $tv]

if {$tvsl == 0  || $tv == "none"} {
    define SET_THROTTLE {set nothrottle}
    set tv "unlimited"
} else {
    # Rewrite symbolic values with values SIMH can understand.  See
    # README-throttle.md for the justification of these values.
    if {$tv == "single-core" } {
        # Build for a single-core Pi board, so just tell SIMH to take half
        # the host CPU power, leaving the rest left for background
        # tasks.  We can't use an IPS value here for several reasons.
        # See README-throttle.md for details.
        set tv "50%"
    } elseif {$tv == "pdp8e"} {
        set tv "416k"
    } elseif {$tv == "pdp8i" || $tv == "pdp8a"} {
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
    } elseif {$tv == "human"} {
        set tv "1/100"
    } elseif {$tv == "trace"} {
        set tv "1/1000"
    }
    # else, assume --throttle was given a legal SIMH throttle value
    
    if {[string first "/" $tv] > -1} {
        # Assume the ratio given will push us below 1 kIPS, where ILS
        # fails badly because of the simulator's sleeping behavior, so
        # disable the ILS feature if we were going to build it.
        set cores 1
    }

    define SET_THROTTLE "set throttle $tv"
}
msg-result "Simulator CPU throttle set to $tv"

# Swap the incandescent lamp simulator feature out for the original LED
# driving method on single-core hosts.  The user can force this on
# multi-core hosts via --no-lamp-simulator.
if {($cores < 2) || [opt-bool no-lamp-simulator]} {
    msg-result "Driving PiDP-8/I front panel LEDs using low-CPU-usage method."
    define LED_DRIVER_MODULE n
    define ILS_MODE 0
} else {
    msg-result "Driving PiDP-8/I front panel LEDs using incandescent lamp simulator."
    define LED_DRIVER_MODULE i
    define ILS_MODE 1
}

# Check for headers, functions, etc. whose absence we can work around
cc-check-decls __progname
cc-check-includes time.h
cc-check-includes pcre.h pcreposix.h
cc-check-function-in-lib clock_gettime rt
cc-check-functions clock_nanosleep nanosleep usleep







<
<
<
<
<
<
<




|
|
|
|
<
<
<
<
|
|
|
<







350
351
352
353
354
355
356







357
358
359
360
361
362
363
364




365
366
367

368
369
370
371
372
373
374
    } elseif {$tv == "human"} {
        set tv "1/100"
    } elseif {$tv == "trace"} {
        set tv "1/1000"
    }
    # else, assume --throttle was given a legal SIMH throttle value
    







    define SET_THROTTLE "set throttle $tv"
}
msg-result "Simulator CPU throttle set to $tv"

# Always build the ILS version. NLS can be forced by calling the 
# executable with a special name, tho. ILS also falls back to 
# NLS with Throttling set to a a/b "ratio".
 




msg-result "Driving PiDP-8/I front panel LEDs using incandescent lamp simulator."
define LED_DRIVER_MODULE i
define ILS_MODE 1


# Check for headers, functions, etc. whose absence we can work around
cc-check-decls __progname
cc-check-includes time.h
cc-check-includes pcre.h pcreposix.h
cc-check-function-in-lib clock_gettime rt
cc-check-functions clock_nanosleep nanosleep usleep

Changes to bin/pidp8i.in.

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61




62
63
64
65
66
67
68
bootdir="@BOOTDIR@"
prefix="@ABSPREFIX@"
sim="$prefix/bin/pidp8i-sim"
scanswitch="$prefix/libexec/scanswitch"
systemctl=$(uname -r | grep -qw Microsoft && echo /bin/nothing || echo /bin/systemctl)
ggrep=$(which ggrep grep 2> /dev/null | head -1)

# For experts:
# uncomment and set values for the RISING and FALLING factors respectively 
# for manual tweaking of the "incandescent lamp simulation" effect.
# Values need to be between 1 and 0, higher values mean faster change, lower values
# more sluggish response of the lights (more "glowing")
# (this might now work as expected when using tmux instead of screen because of the
# way tmux deals with passing the environment
#
#export PIDP8I_ILS_TWEAK="0.2775,0.0975"
#
# visual dynamic range compression/stretching, uncomment to turn off or use your own values.
# The sum of those 33 integers should roughly be around 600..700
# Higher values at the i-th position means that brighness level i-1 gets more LED-"on"-time
# the following restores "equal increments per brighness level" 
#export PIDP8I_ILS_RAMP="0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20"
#
# uncomment to activate ILS test pattern: Brightnesss values range 0...32 in third row
#export PIDP8I_ILS_TEST="on"

if [ -e "$prefix/etc/pidp8i.rc" ]
then
    . "$prefix/etc/pidp8i.rc"




fi
[ -n "$SCREEN_MANAGER" ] || SCREEN_MANAGER=screen
if [ ! -t 1 ] && [ "$SCREEN_MANAGER" = "none" ]
then
    echo "The 'none' screen manager mode is meant for interactive use only!"
    exit 1
fi







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



>
>
>
>







33
34
35
36
37
38
39



















40
41
42
43
44
45
46
47
48
49
50
51
52
53
bootdir="@BOOTDIR@"
prefix="@ABSPREFIX@"
sim="$prefix/bin/pidp8i-sim"
scanswitch="$prefix/libexec/scanswitch"
systemctl=$(uname -r | grep -qw Microsoft && echo /bin/nothing || echo /bin/systemctl)
ggrep=$(which ggrep grep 2> /dev/null | head -1)




















if [ -e "$prefix/etc/pidp8i.rc" ]
then
    . "$prefix/etc/pidp8i.rc"
    export PIDP8I_ILS_MIN_CORES
    export PIDP8I_FORCE_NLS
    export PIDP8I_ILS_TWEAK
    export PIDP8I_ILS_TEST
fi
[ -n "$SCREEN_MANAGER" ] || SCREEN_MANAGER=screen
if [ ! -t 1 ] && [ "$SCREEN_MANAGER" = "none" ]
then
    echo "The 'none' screen manager mode is meant for interactive use only!"
    exit 1
fi

Changes to etc/pidp8i.rc.

1
2
3
4
5

























# PiDP-8/I runtime configuration file.  See it README.md file or
# https://tangentsoft.com/pidp8i/doc/trunk/README.md#runtime

# Alternatives: none, tmux
SCREEN_MANAGER=screen






























>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# PiDP-8/I runtime configuration file.  See it README.md file or
# https://tangentsoft.com/pidp8i/doc/trunk/README.md#runtime

# Alternatives: none, tmux
SCREEN_MANAGER=screen

# minimum number of cores to enable ILS mode
PIDP8I_ILS_MIN_CORES=2

# uncomment to force NLS_MODE
#PIDP8I_FORCE_NLS=1

# For experts:
# uncomment PIDP8I_ILS_TWEAK and set values for the RISING and FALLING factors respectively 
# for manual tweaking of the "incandescent lamp simulation" effect.
# Values need to be between 1 and 0, higher values mean faster change, lower values
# more sluggish response of the lights (more "glowing")
# (this might now work as expected when using tmux instead of screen because of the
# way tmux deals with passing the environment
#
#PIDP8I_ILS_TWEAK="0.2775,0.0975"
#
# visual dynamic range compression/stretching, uncomment to turn off or use your own values.
# The sum of those 33 integers should roughly be around 600..700
# Higher values at the i-th position means that brighness level i-1 gets more LED-"on"-time
# the following restores "equal increments per brighness level" 
#export PIDP8I_ILS_RAMP="0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20"
#
# uncomment to activate ILS test pattern: Brightnesss values range 0...32 in third row
#PIDP8I_ILS_TEST="on"

Changes to src/SIMH/scp.c.

278
279
280
281
282
283
284

285
286


287
288
289
290
291
292
293
#endif

#if defined(SIM_NEED_GIT_COMMIT_ID)
#include ".git-commit-id.h"
#endif

#ifdef PIDP8I

#include <pidp8i.h>
int use_pidp8i_extensions = 1;


#endif

#ifndef MAX
#define MAX(a,b)  (((a) >= (b)) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b)  (((a) <= (b)) ? (a) : (b))







>


>
>







278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#endif

#if defined(SIM_NEED_GIT_COMMIT_ID)
#include ".git-commit-id.h"
#endif

#ifdef PIDP8I
#include <sys/sysinfo.h>
#include <pidp8i.h>
int use_pidp8i_extensions = 1;
extern int forceILS;
extern int forceNLS;
#endif

#ifndef MAX
#define MAX(a,b)  (((a) >= (b)) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b)  (((a) <= (b)) ? (a) : (b))
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838















2839

2840
2841
2842
2843
2844
2845
2846
    else {
        if ((strlen (argv[i]) + strlen (cbuf) + 3) >= sizeof(cbuf)) {
            fprintf (stderr, "Argument string too long\n");
            free (targv);
            return EXIT_FAILURE;
            }
        if (*cbuf)                                      /* concat args */
            strlcat (cbuf, " ", sizeof (cbuf)); 
        sprintf(&cbuf[strlen(cbuf)], "%s%s%s", strchr(argv[i], ' ') ? "\"" : "", argv[i], strchr(argv[i], ' ') ? "\"" : "");
        lookswitch = FALSE;                             /* no more switches */
        }
    }                                                   /* end for */
if (*argv[0]) {                                         /* sim name arg? */
    char *np;                                           /* "path.ini" */

    strlcpy (nbuf, argv[0], PATH_MAX + 2);              /* copy sim name */
    if ((np = (char *)match_ext (nbuf, "EXE")))         /* remove .exe */
        *np = 0;
    np = strrchr (nbuf, '/');                           /* stript path and try again in cwd */
    if (np == NULL)
        np = strrchr (nbuf, '\\');                      /* windows path separator */
    if (np == NULL)
        np = strrchr (nbuf, ']');                       /* VMS path separator */
    if (np != NULL)
        setenv ("SIM_BIN_NAME", np+1, 1);               /* Publish simulator binary name */
    setenv ("SIM_BIN_PATH", argv[0], 1);

#ifdef PIDP8I
    if (strstr (argv[0], "pidp8i-sim") == 0) use_pidp8i_extensions = 0;















    else if (start_pidp8i_gpio_thread (0) != 0) exit (EXIT_FAILURE);

#endif
    }

sim_quiet = sim_switches & SWMASK ('Q');                /* -q means quiet */
sim_on_inherit = sim_switches & SWMASK ('O');           /* -o means inherit on state */

sim_init_sock ();                                       /* init socket capabilities */







|




















|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>







2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
    else {
        if ((strlen (argv[i]) + strlen (cbuf) + 3) >= sizeof(cbuf)) {
            fprintf (stderr, "Argument string too long\n");
            free (targv);
            return EXIT_FAILURE;
            }
        if (*cbuf)                                      /* concat args */
            strlcat (cbuf, " ", sizeof (cbuf));
        sprintf(&cbuf[strlen(cbuf)], "%s%s%s", strchr(argv[i], ' ') ? "\"" : "", argv[i], strchr(argv[i], ' ') ? "\"" : "");
        lookswitch = FALSE;                             /* no more switches */
        }
    }                                                   /* end for */
if (*argv[0]) {                                         /* sim name arg? */
    char *np;                                           /* "path.ini" */

    strlcpy (nbuf, argv[0], PATH_MAX + 2);              /* copy sim name */
    if ((np = (char *)match_ext (nbuf, "EXE")))         /* remove .exe */
        *np = 0;
    np = strrchr (nbuf, '/');                           /* stript path and try again in cwd */
    if (np == NULL)
        np = strrchr (nbuf, '\\');                      /* windows path separator */
    if (np == NULL)
        np = strrchr (nbuf, ']');                       /* VMS path separator */
    if (np != NULL)
        setenv ("SIM_BIN_NAME", np+1, 1);               /* Publish simulator binary name */
    setenv ("SIM_BIN_PATH", argv[0], 1);

#ifdef PIDP8I
    if (strstr (argv[0], "pidp8i-sim") == 0) {
        use_pidp8i_extensions = 0;
    } else {
        forceNLS = (strstr (argv[0], "pidp8i-sim-nls") != 0);
        forceILS = (strstr (argv[0], "pidp8i-sim-ils") != 0);

        // handle case when neither forceXXX is set
        if ( !forceNLS && !forceILS ) {
            // get number of cores usable by this process
            int cores = get_nprocs();
            char * min_cores_env = getenv("PIDP8I_ILS_MIN_CORES");
            char * force_nls_env = getenv("PIDP8I_FORCE_NLS");
            int min_cores = (min_cores_env) ? atoi(min_cores_env) : 2;
            int force_nls = (force_nls_env) ? atoi(force_nls_env) : 0;
            forceNLS = ( cores < min_cores || force_nls_env != 0 );
        }
        if (start_pidp8i_gpio_thread (0) != 0) exit (EXIT_FAILURE);
    }
#endif
    }

sim_quiet = sim_switches & SWMASK ('Q');                /* -q means quiet */
sim_on_inherit = sim_switches & SWMASK ('O');           /* -o means inherit on state */

sim_init_sock ();                                       /* init socket capabilities */

Changes to src/pidp8i/gpio-common.c.in.

145
146
147
148
149
150
151





152
153
154
155
156
157
158
// Flag to override ILS mode, forcing fallback to NLS mode.  Set when
// the PDP-8 instruction decoding loop detects that we're using the
// ratio form of SET THROTTLE, which prevents the use of ILS due to the
// way instructions are executed in that mode.  Defined here rather than
// in gpio-ils.c because we don't want to make code that sets this
// conditional based on whether ILS is in fact actually enabled.
int suppressILS = 0;






// Flag set when sim_instr() exits due to some SIMH event like Ctrl-E,
// which lets us resume from our imposed "pause" display state.
int resumeFromInstructionLoopExit = 0;


// SCP's signal handlers, which we extend.







>
>
>
>
>







145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// Flag to override ILS mode, forcing fallback to NLS mode.  Set when
// the PDP-8 instruction decoding loop detects that we're using the
// ratio form of SET THROTTLE, which prevents the use of ILS due to the
// way instructions are executed in that mode.  Defined here rather than
// in gpio-ils.c because we don't want to make code that sets this
// conditional based on whether ILS is in fact actually enabled.
int suppressILS = 0;

// Flags to force either ILS or NLS mode, set via the executable name
// suppressILS will override forceILS
int forceILS = 0,  forceNLS = 0;


// Flag set when sim_instr() exits due to some SIMH event like Ctrl-E,
// which lets us resume from our imposed "pause" display state.
int resumeFromInstructionLoopExit = 0;


// SCP's signal handlers, which we extend.
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
           "PiDP-8/I @VERSION@ [%s] [%cls] [%spcb] [%sgpio]"

#ifdef DEBUG
        " [debug]"
#endif
        "%s",
        pt,
        ILS_MODE ? 'i' : 'n',
        pt[0] == 'p' ? 
#ifdef PCB_SERIAL_MOD_OV
            "sermod" : 
#elif PCB_SERIAL_MOD_JLW
            "altser" : 
#else
            "std" : 







|







555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
           "PiDP-8/I @VERSION@ [%s] [%cls] [%spcb] [%sgpio]"

#ifdef DEBUG
        " [debug]"
#endif
        "%s",
        pt,
        forceNLS ? 'n' : 'i',
        pt[0] == 'p' ? 
#ifdef PCB_SERIAL_MOD_OV
            "sermod" : 
#elif PCB_SERIAL_MOD_JLW
            "altser" : 
#else
            "std" : 

Changes to src/pidp8i/gpio-ils.c.

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
            // fill one panel row of 12 lights with test pattern
            for (int col=0; col < 12 ; col++) {
                brightness[2][col]=test_pattern[col];
            }
        }

        // Light up LEDs
        extern int swStop, swSingInst, suppressILS;
        if (swStop || swSingInst || suppressILS) {

	    // The CPU is in STOP mode or someone has suppressed the ILS,
            // so show the current LED states full-brightness using the
            // same mechanism NLS uses.  No need to force a display swap
            // in case this isn't STOP mode as it will happen on the next
            // loop interation anyway.
            update_led_states (intervl * 60);







|
|







201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
            // fill one panel row of 12 lights with test pattern
            for (int col=0; col < 12 ; col++) {
                brightness[2][col]=test_pattern[col];
            }
        }

        // Light up LEDs
        extern int swStop, swSingInst, suppressILS, forceNLS;
        if (swStop || swSingInst || suppressILS || forceNLS) {

	    // The CPU is in STOP mode or someone has suppressed the ILS,
            // so show the current LED states full-brightness using the
            // same mechanism NLS uses.  No need to force a display swap
            // in case this isn't STOP mode as it will happen on the next
            // loop interation anyway.
            update_led_states (intervl * 60);

Changes to src/pinctrl/LICENSE.

1
2
3
4
5
6
7
8
9

minor changes (c) 2024 Heinz-Bernd Eggenstein
pinctrl code copyright notice:


Copyright (c) 2023, Raspberry Pi Ltd.

All rights reserved.


<







1

2
3
4
5
6
7
8


pinctrl code copyright notice:


Copyright (c) 2023, Raspberry Pi Ltd.

All rights reserved.

Changes to src/pinctrl/gpiolib.c.

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
        return NULL;

    num_gpio_chips++;

    return inst;
}

static inline int gpio_get_interface(unsigned gpio,
                              const GPIO_CHIP_INTERFACE_T **iface_ptr,
                              void **priv, unsigned *offset)
{

    static GPIO_CHIP_INSTANCE_T * cache_inst[MAX_GPIO_PINS];
    unsigned i;
    // change May 2024
    // Modification specifically for PiDP8i
    // do not use in other contexts where pinctrl functions get
    // called from different threads
    if (gpio_num_is_valid(gpio) && cache_inst[gpio]) {
        GPIO_CHIP_INSTANCE_T *inst =cache_inst[gpio];
        const GPIO_CHIP_T *chip = inst->chip;
        *iface_ptr = chip->interface;
        *priv = inst->priv;
        *offset = gpio - inst->base;
        return 0;
    }

    *iface_ptr = NULL;
    for (i = 0; i < num_gpio_chips; i++)
    {
        GPIO_CHIP_INSTANCE_T *inst = &gpio_chips[i];
        const GPIO_CHIP_T *chip = inst->chip;
        if (gpio >= inst->base && gpio < (inst->base + inst->num_gpios))
        {
            cache_inst[gpio]=inst;
            *iface_ptr = chip->interface;
            *priv = inst->priv;
            *offset = gpio - inst->base;
            return 0;
        }
    }
    return -1;







|



<
<

<
<
<
<
<
<
<
<
<
<
<
<








<







73
74
75
76
77
78
79
80
81
82
83


84












85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
        return NULL;

    num_gpio_chips++;

    return inst;
}

static int gpio_get_interface(unsigned gpio,
                              const GPIO_CHIP_INTERFACE_T **iface_ptr,
                              void **priv, unsigned *offset)
{


    unsigned i;













    *iface_ptr = NULL;
    for (i = 0; i < num_gpio_chips; i++)
    {
        GPIO_CHIP_INSTANCE_T *inst = &gpio_chips[i];
        const GPIO_CHIP_T *chip = inst->chip;
        if (gpio >= inst->base && gpio < (inst->base + inst->num_gpios))
        {

            *iface_ptr = chip->interface;
            *priv = inst->priv;
            *offset = gpio - inst->base;
            return 0;
        }
    }
    return -1;