clockworkpi / DevTerm

This code repository offers downloads for the latest images of various DevTerm models, as well as kernel patches, keyboard firmware, the source code for screen and printer drivers, hardware schematics, assembly instructions, and essential technical documents.
GNU Lesser General Public License v2.1
387 stars 68 forks source link

wiringPi: allow external pins in pinMode, digitalRead, digitalWrite #50

Closed yatli closed 1 year ago

yatli commented 1 year ago

This patch allows external pins the way WiringPi is designed to. For example, one can setup mcp23008 and base it at pin 100 like this:

  if (1 != mcp23008Setup(100, 0x20)) {
    die("Failed to setup mcp23008\n");
  }
  // ...
  pinMode(100, INPUT);
  digitalRead(100);

Without this patch, the WiringCPi logic intercepts the requests and report "invalid pin".