Frage zum Treiberimport

Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2134
Registered: 03 / 2003
Subject:

Frage zum Treiberimport

 · 
Posted: 30.03.2021 - 18:47  ·  #1
Hallo zusammen,

heute kam mir ein Gedanke ......

Spielt die Reihenfolge der Treiberimports eine Rolle, wenn es um die Position des Treibercodes im Flash und der Variablen im RAM geht? Spielt die Reihenfolge unabhängig davon im Define-Block auch eine Rolle? Kann es sein, daß eine geänderte Reihenfolge dazu führen kann, daß ein Programm nicht funktioniert?

Gruss
Harry
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1409
Registered: 03 / 2005
Subject:

Re: Frage zum Treiberimport

 · 
Posted: 30.03.2021 - 19:58  ·  #2
IMO....

Yes the order would probably affect position of driver code BUT the drivers should be independent and a change in order should not of itself cause a program to not work. Nor does it play a role in the define block afaik. There you can define things in any order - they are effectively like global variables.

Do you feel there is a situation where this has had an effect?
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2134
Registered: 03 / 2003
Subject:

Re: Frage zum Treiberimport

 · 
Posted: 31.03.2021 - 09:23  ·  #3
Hello Merlin,

I still have the problem that a ping (wzTINA) changes the 2 PWM values of my display lighting. Miparo told me that I should change the order of the drivers. I have not yet had the chance to test this. I hope to do so at the end of the week.

Harry
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1409
Registered: 03 / 2005
Subject:

Re: Frage zum Treiberimport

 · 
Posted: 31.03.2021 - 09:52  ·  #4
Interesting.

I was going to say (but thought it might be going off topic) that drivers also have uses clauses, and the order of uses clauses can be important. The reason for that is to do with names of globals (variables, functions or procedures). When you access these in code you write something like

Code
x := MyStuff;


When you look at the assembler it uses a qualified name, something like MyUnit.Mystuff.

The problem is that MyStuff might be defined in multiple units, and just like Delphi, scoping rules (and hence order of placing within uses clauses) apply. Unlike Delphi, though, global variables are more common in AVRCo, so you are more likely to hit this problem, but you definitely can hit the problem with Delphi too. (In fact some hacks in Delphi take advantage of it!)

But this is an issue with uses clauses rather than drivers per se.

So I don't know changing the order of drivers in the import section might have an effect, but I would start with changing the order within the uses clauses first.

But I emphasise - this is just an opinion, not certain knowledge.
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 13   78   91 · Page-Gen-Time: 0.026501s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI