AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Comparing functions

Ein Thema von Razor · begonnen am 28. Aug 2007 · letzter Beitrag vom 8. Nov 2007
Antwort Antwort
Seite 1 von 9  1 23     Letzte »    
Razor
(Gast)

n/a Beiträge
 
#1

Comparing functions

  Alt 28. Aug 2007, 20: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!
  Mit Zitat antworten Zitat
Benutzerbild von Mackhack
Mackhack

Registriert seit: 29. Nov 2003
Ort: San Diego, CA/USA
1.446 Beiträge
 
Delphi 2006 Architect
 
#2

Re: Comparing functions

  Alt 28. Aug 2007, 21:06
Did you write this code or did you copy and paste it again like all the other code fragments you've showed us so far?
Um etwas Neues zu schaffen muss man seine Ohren vor den Nein-sagern verschliessen um seinen Geist öffnen zu können.
(George Lukas)
  Mit Zitat antworten Zitat
Alt 28. Aug 2007, 21:11     Erstellt von Razor
Dieser Beitrag wurde von Matze gelöscht. - Grund: Beitrag auf Wunsch von Razor ausgeblendet.
Der_Unwissende

Registriert seit: 13. Dez 2003
Ort: Berlin
1.756 Beiträge
 
#3

Re: Comparing functions

  Alt 29. Aug 2007, 09:38
Zitat von Razor:
Can driver 2 functions be used same as driver 1 in this way
Well, take a minute (just one minute, ok!) to think about it! How could you expect two different functions to work the same way? They don't even have the same signature.

I don't know how you could expect meeting your deadline without having any knowledge about the pure Delphi-basics at all. Sorry man, but if you don't even get the meaning of these lines you've posted...
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#4

Re: Comparing functions

  Alt 29. Aug 2007, 10:20
Yes i do understand them,they both read dword from pci bus,but maybe is it better to join the 2 driver to 1 single driver?What you think about that?
  Mit Zitat antworten Zitat
Muetze1
(Gast)

n/a Beiträge
 
#5

Re: Comparing functions

  Alt 29. Aug 2007, 10:35
Both driver offer the same functionality so device which one to use and then change your code to use the selected one...
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#6

Re: Comparing functions

  Alt 29. Aug 2007, 10:37
So basicly here goes for an old version of a driver and a new version of a driver wich has also x64,x86.But why does it delphi give out L1333 internal error I dont understand this...


The second driver also provides msr read functions basicly both do....
  Mit Zitat antworten Zitat
OlafSt

Registriert seit: 2. Mär 2007
Ort: Hamburg
284 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#7

Re: Comparing functions

  Alt 29. Aug 2007, 11:36
Where does this highly interesting code comes from ?
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#8

Re: Comparing functions

  Alt 29. Aug 2007, 11:40
Basicly this can't compile...

Delphi-Quellcode:
var
pdata:Cardinal;
begin

omcdrv.GetPCIRDWord(0,24,$03,$E4,pdata); // Here i get Internal error L1333
omcdrv.SetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2));

C0:= Format('%d °C',[(pdata shr 16 and $FF)-49]);
Label0.Caption := C0;



//procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; var pdata: Cardinal);
  Mit Zitat antworten Zitat
Torpedo

Registriert seit: 21. Dez 2003
410 Beiträge
 
#9

Re: Comparing functions

  Alt 29. Aug 2007, 12:10
Zitat von OlafSt:
Where does this highly interesting code comes from ?
Found some parts with Google Code
URL
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#10

Re: Comparing functions

  Alt 29. Aug 2007, 12:12
Yes that is AMD64 Core Temperature!Posted by hathor made by deamonES...Do i need to say more?
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 9  1 23     Letzte »    


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:17 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz