EasyManua.ls Logo

ARTERY AT32 - Preserving User Code

Default Icon
27 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
AT32 Work Bench User Manual
2024.03.05 23 Ver 1.04
4.5.2 Keep user code when re-generating
The AT32 Work Bench generated C code allows users to add custom code. The custom code
needs to be inserted into the software-defined location and can be reserved for the next generation
of C code. The software-defined location is as follows:
/* add user code begin …... */
/* add user code end ...... */
When re-generating code, user codes in the software-defined position are reserved and not moved
or renamed, while user codes not in the software-defined location are ignored and discarded.
Note 1: User-defined
add user code
tag is not supported. Custom code can be added to
software-defined tags only.
Note 2: Code annotation cannot be the same as the software-defined
add user code
tag.
Take the main function in main.c as an example. User code can be added to the software-defined
positions (in bold).
int main(void)
{
/* add user code begin 1 */
/* add user code end 1 */
/* system clock config. */
wk_system_clock_config();
/* nvic config. */
wk_nvic_config();
/* add user code begin 2 */
/* add user code end 2 */
while(1)
{
/* add user code begin 3 */
/* add user code end 3 */
}
}