SAmeis / pascalio

Input/Output library for Raspberry Pi or any other Linux based microcontroller
Other
29 stars 9 forks source link

Linux GPIO direction doesn't reflect the value set #1

Closed SAmeis closed 10 years ago

SAmeis commented 10 years ago

In the following program the testing condition on GPIO's direction is never executed.

program Project1;

{$mode objfpc}{$H+}

uses
  pascalio, fpgpio
  { you can add units after this };
var
  RAIO_RST: TGpioPin;
begin
  RAIO_RST := TGpioLinuxPin.Create(22);
  RAIO_RST.direction := gdin;
  if RAIO_RST.direction = gdIn then begin
    writeln('PIN 22 direction: in');
    Writeln('This is never executed');
  end;
  writeln('ENDE');
  RAIO_RST.Destroy;
end.
SAmeis commented 10 years ago

Issue not fixed; the direction file returns the direction string followed by a line feed 'in'#10. This should also affect intterupt mode.