global assignment

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
Pelikan
Posts: 219
Joined: 22 Nov 2012 07:58

global assignment

#1 Post by Pelikan » 17 Mar 2020 08:23

Hello,
how can a global assignment be created for all units?
or the other way around:
how can an error message be prevented if it is redefined (but with exactly the same value)?

with regards
Peter

TurboProgger
Posts: 66
Joined: 04 Oct 2008 18:39
Location: Germany

Re: global assignment

#2 Post by TurboProgger » 18 Mar 2020 12:35

Just create a new unit, name it for example 'global.mpas' and include it with 'uses' statement in all other units of your needs.
This unit could be used to hold all global types, consts, vars, strings and so on.

Pelikan
Posts: 219
Joined: 22 Nov 2012 07:58

Re: global assignment

#3 Post by Pelikan » 23 Mar 2020 16:40

Hello,
with unit I thought too, but ...

(* MCU STM32F303CC *)

{$IfDef STM32F3XX} // that works
// {$DEFINE F3_CAN1_PA11_12}
{$DEFINE F3_CAN1_PB8_9}
{$EndIf}

F3_CAN1_PB8_9 is not defined.
what now?

with regards
Peter

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: global assignment

#4 Post by filip.grujcic » 24 Mar 2020 13:15

Hello,

Try to write the full MCU name STM32F303CC instead of STM32F3xx part.

Regards,
Filip Grujcic

Post Reply

Return to “mikroPascal PRO for ARM General”