News:

;) This forum is the property of Proton software developers

Main Menu

[Solved] Restricting compilation for a specific MCU

Started by keytapper, May 04, 2024, 07:50 AM

Previous topic - Next topic

keytapper

Hello,
I'm about to write for a enhanced MCU family. I'd like to use the indirect pointing so there's a limit on compiling such condition.
I read the manual which has the _ecore definition but it's not showing the correct error statement.
$if _ecore != 1
$error Review your MCU setting type
$endif

It triggers, but not printing my error statement. What is the  _core value?
Anything to correct it?
Ignorance comes with a cost

DaveS

Hi
Try $SendError

I used the code below probably OTT

  $if _core = 14   
    $ifdef _ecore
      $if _ecore = 1
        $SendError "Core 14 ecore not supported"
      $endif
    $endif
  $endif

keytapper

Thanks Dave,
I got the clue :
$ifndef _ecore
$error Review your MCU device settings
$endif

That is because, no matter the resulting value is, the _ecore is defined.
Only the message appear entirely in lower case.  :P
Ignorance comes with a cost

DaveS

Quote from: keytapper on May 04, 2024, 12:18 PMThanks Dave,
I got the clue :
$ifndef _ecore
$error Review your MCU device settings
$endif

That is because, no matter the resulting value is, the _ecore is defined.
Only the message appear entirely in lower case.  :P

Surprised $Error works it's not in the manual, I have done the same before.
Les must change it to the
Asm preprocessor #error, #warning, and #message
hence low case

Positron preprocessor
$SendError "Error Text"
$SendWarning "Warning Text"
$SendHint "Hint Text"

$ifndef _ecore
  $SendError "Review your MCU device settings"
$endif

Dave

keytapper

Quote from: DaveS on May 05, 2024, 11:40 AMSurprised $Error works it's not in the manual
It works, but I'll follow your suggestion to avoid losing the capitalization.
Consequently the  <$Send...> will allow quoted text.
Ignorance comes with a cost