Op 08-03-16 om 19:50 schreef Bo Berglund:

In PiGpio I added the following (roundabout line #20:

{$DEFINE RPi2}

const
   REG_GPIO = {$IFDEF RPi2} $3F000 {$ELSE} $20000
{$ENDIF};//bcm2835/bcm2836 gpio register 0x2000 0000. new fpMap uses
page offset, one page is 4096bytes

then later down in the file (around line #150):

function TIoDriver.MapIo: boolean;
begin
  Result := True;
  {$IFDEF RPi2}
    fd := fpopen('/dev/gpiomem', O_RdWr or O_Sync); // Open the master
/dev/memory device
  {$ELSE}
    fd := fpopen('/dev/mem', O_RdWr or O_Sync); // Open the master
/dev/memory device
  {$ENDIF}

I do not know for a fact tha the second change is because of the RPi2
hardware, it was probably put there in order to make my program run as
a normal user rather than su.


Well, that's what I did, although without the conditionals.
Did you try PWM, e.g. with the demo-program ? Does it work ?

Koenraad.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to