Converting C #defines

Mr Crusty
 
Avatar
 
Subject:

Converting C #defines

 · 
Posted: 17.04.2012 - 11:41  ·  #1
Hi All,

Trying to convert some C to E_Lab Pascal, not sure how to convert these defines.

Code

#define DDR_My             DDRB
#define PORT_My           PORTB
#define PIN_My             PINB


Any help appreciated.

Best
Crusty : :-/
miparo
Administrator
Avatar
Gender:
Location: Germany
Age: 59
Posts: 956
Registered: 09 / 2007
Subject:

Re: Converting C #defines

 · 
Posted: 17.04.2012 - 12:21  ·  #2
Hi Crusty,
try this

Code

Var
  DDR_my[@DDRB] : byte;
  Port_my[@PortB] : byte;
  PIN_my[@PinbB] : byte;


//....
  DDR_My:=$FF;
  Port_my:=$AA;
  PIN_my.5:=1; 

Mr Crusty
 
Avatar
 
Subject:

Re: Converting C #defines

 · 
Posted: 17.04.2012 - 13:37  ·  #3
Miparo,

That looks to be just what I needed.

I have used this assignment before, but quite forgot that it would accept an I/O port as an argument.

Your quick response much appreciated.

Best
Crusty
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   64   77 · Page-Gen-Time: 0.05889s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI