(Gast)
n/a Beiträge
|
Comparing functions
28. Aug 2007, 21:06
From IO driver #1
Delphi-Quellcode:
procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; var pdata: DWord);
procedure SetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; pdata: DWord);
From IO driver #2
Delphi-Quellcode:
function GetPCRD(Bus, Dev, Func, Reg : byte): dword;
procedure SetPCRD(Bus, Dev, Func, Reg : byte; value : dword);
Can driver 2 functions be used same as driver 1 in this way
Delphi-Quellcode:
var
dwResult : DWORD;
begin
//-------Reading a temperature of the Core0----------
dwResult:=GetPCRD(0,24,$03,$E4);
SetPCRD(0,24,$03,$E4, dwResult and not (1 shl 2)); //Core0 select
dwResult:=GetPCRD(0,24,$03,$E4);
C0:= Format('%d °C',[(dwResult shr 16 and $FF)-49]);
Label0.Caption := C0;
Form1.Caption:= C0;
Application.Title:= C0;
if not Core2Present then Exit;
//-------Reading a temperature of the Core1----------
dwResult:=GetPCRD(0,24,$03,$E4);
SetPCRD(0,24,$03,$E4, dwResult or (1 shl 2)); //Core1 select
dwResult:=GetPCRD(0,24,$03,$E4);
Label1.Caption := Format('%d °C',[(dwResult shr 16 and $FF)-49]);
I have tried it this way but i can't even compile this becouse IDE gives an error Internal L1333 error.
Delphi-Quellcode:
var
pdata : DWORD;
begin
//-------Reading a temperature of the Core0----------
GetPCIRDWord(0,24,$03,$E4,pdata);
SetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2)); //Core0 select
GetPCIRDWord(0,24,$03,$E4,pdata);
C0:= Format('%d °C',[(pdata shr 16 and $FF)-49]);
Label0.Caption := C0;
Form1.Caption:= C0;
Application.Title:= C0;
if not Core2Present then Exit;
//-------Reading a temperature of the Core1----------
GetPCIRDWord(0,24,$03,$E4,pdata);
SetPCIRDWord(0,24,$03,$E4, pdata or (1 shl 2)); //Core1 select
GetPCIRDWord(0,24,$03,$E4,pdata);
Label1.Caption := Format('%d °C',[(pdata shr 16 and $FF)-49]);
Thanks!
|