Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/bcm2708.pas
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
interface

uses
Classes, SysUtils, baseunix, unix, rtlconsts;
Classes, SysUtils, {$IFDEF LINUX} baseunix, unix, {$ENDIF} rtlconsts;
(*
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -29,6 +29,12 @@ interface
PAGE_SIZE = (4*1024);
BLOCK_SIZE = (4*1024);

{$IFDEF LINUX}
type
cint=integer;
off_t=integer;


var
mem_fd: cint = 0;
gpio_map: Pointer = nil;
Expand All @@ -48,9 +54,9 @@ procedure setup_io();
function mmap(addr: Pointer; _length: size_t; prot: cint; flags: cint; fd: cint; offset: off_t): Pointer; cdecl; external 'libc';
//void *mmap(void *addr, size_t length, int prot, int flags,
// int fd, off_t offset);

{$ENDIF}
implementation

{$IFDEF LINUX}
procedure INP_GPIO(g: PtrUInt);
begin
//#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))
Expand Down Expand Up @@ -118,6 +124,6 @@ procedure setup_io();
end;
gpio := gpio_map;
end; // setup_io

{$ENDIF}
end.