Skip to main content
Lukasz Przenioslo
Associate III
August 11, 2018
Question

L4 cubeMx package ver 1.12 inconsistency

  • August 11, 2018
  • 2 replies
  • 1501 views

Hello there,

Here is my CubeMX version:

0690X000006BsfKQAS.png

Here is my L4 libs version:

 0690X000006BsfPQAS.png

I have noticed some disturbing inconsistencies in the #ifdef include guards generated in the default peripherals code. So far all peripherals has guards like this:

#ifndef __STM32L4xx_HAL_FLASH_H
#define __STM32L4xx_HAL_FLASH_H

Now, only some peripherals has those. Some others use these:

#ifndef STM32L4xx_HAL_I2C_H
#define STM32L4xx_HAL_I2C_H

Why remove the "__" suffix in some libs? I only noticed those, because I was using those defines for something. Please confirm. @Imen DAHMEN​ ?

This topic has been closed for replies.

2 replies

ST Technical Moderator
August 13, 2018

Hello @Community member​ ,

The double underscore (__) removed to apply MISRA-C 2012 compliance.

Noted that we are still setting the MISRA-C 2012 rules .

With Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Lukasz Przenioslo
Associate III
August 13, 2018

Ok, but why only for some files?