Bascom ---> Pascal

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Page 2 of 6
Merlin
Administrator
Avatar
Gender:
Age: 25
Posts: 1410
Registered: 03 / 2005
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 04.08.2022 - 16:13  ·  #9
Hi All.

This is already implemented for I2COut.

There is an optional parameter "NOSTOP".

so

Code
bool:= I2Cout(device_adres,Reg_adres, NOSTOP);


Regards

Merlin
miparo
Administrator
Avatar
Gender:
Location: Germany
Age: 58
Posts: 959
Registered: 09 / 2007
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 04.08.2022 - 16:14  ·  #10
Hi Merlin,
that's exactly how it is.
Just described it a bit different, but we mean the same thing :)

Code

procedure DisableI2CAutoAck( value : boolean );
begin
  SetBit( Flags2, 7, value );
end; 


This is just a quick & dirty solution.


bool:= I2Cout(device_adres,Reg_adres, NOSTOP);
Oh never seen that, that simplifies it yes.


miparo
Merlin
Administrator
Avatar
Gender:
Age: 25
Posts: 1410
Registered: 03 / 2005
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 04.08.2022 - 16:18  ·  #11
Hi Miparo

I deleted my post - it was wrong ;-)
miparo
Administrator
Avatar
Gender:
Location: Germany
Age: 58
Posts: 959
Registered: 09 / 2007
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 04.08.2022 - 16:19  ·  #12
yes i see.
Compiler Error :)
Mathias
Benutzer
Avatar
Gender: n/a
Location: Weingarten - Baden
Posts: 311
Registered: 07 / 2003
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 04.08.2022 - 23:11  ·  #13
bool:= I2Cout(device_adres,Reg_adres, NoStop);

so würde es dann gehen ...
Wäre gut.
Bin gespannt.
Merlin
Administrator
Avatar
Gender:
Age: 25
Posts: 1410
Registered: 03 / 2005
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 04.08.2022 - 23:33  ·  #14
Hi Mathias

This is not a proposal. It is already there. But not documented it seems.

=======================================================

Hallo Mathias

dies ist kein Vorschlag. Es ist bereits vorhanden. Aber nicht dokumentiert, wie es scheint.
miparo
Administrator
Avatar
Gender:
Location: Germany
Age: 58
Posts: 959
Registered: 09 / 2007
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 05.08.2022 - 01:26  ·  #15
Hi Merlin ,
that's right but there is still two bug here ?

Code

type
 TArr20 = Array[0..19] of byte;
const
     BME280         : byte = $76;
var
  Arr20 : TArr20;

procedure I2CwriteBuffer(Reg,Count: byte; const Data: TArr20 );
var idx : byte;
begin
  for idx := 0 to Count-1 do   // with Data as const : Error Left side cannot be assigned to !!!!
    I2Cout(BME280, Reg, data[idx], NOSTOP);  // Error: identifier or factor expected
    I2Cout(BME280, Reg, 12, NOSTOP);  // that's OK
  endfor;
end;



Compiler version 5.11.15.2

miparo
Merlin
Administrator
Avatar
Gender:
Age: 25
Posts: 1410
Registered: 03 / 2005
Subject:

Re: Bascom ---> Pascal

 · 
Posted: 05.08.2022 - 11:10  ·  #16
Thanks for your diligence Miparo.

I will sort it.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Page 2 of 6
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: 14   134   148 · Page-Gen-Time: 0.034888s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI