Skip to main content
December 19, 2019
Question

Is there a directive to demarcate the user code entered?

  • December 19, 2019
  • 4 replies
  • 857 views

Device Configuration Tool Code Generation performs a code update, and if the user enters a code in an unmarked location, that code will be deleted.

Is there a directive (something like #codeuser #endcodeuser) to demarcate the user code entered?

This topic has been closed for replies.

4 replies

KnarfB
Super User
December 19, 2019

/* USER CODE BEGIN ... */

your code here

/* USER CODE END ... */

December 19, 2019

Yes, that I know, thank you,

But what about subroutines that don't have this comment?

Can i add this comment wherever i want and the generator will keep my code?

January 4, 2020

I tried to add comments to delimit the user code, but the compiler did not respect the delimitation and deleted the code while updating the code through the generator tool.

It will be very useful to have a tag for the user to be able to modify the library without the generator deleting the manually entered code.

February 5, 2020

I am getting around the lack of user code policy, with the cloning of modified subroutines saved in the predefined locations for user code, but it is very irritating to have to make comments in parts of code when performing a hardware selection update, via Device Configuration Tool.

Pavel A.
Super User
February 5, 2020

Microsoft has #pragma region. For similar purposes IIRC.

-- pa