You can use code blocks within any function to separate scopes
or logically separate chunks of code and label them with a comment or label.
#include "stdio.h"
#include "stdint.h"
uint8_t GlobalVar_g = 5;
int32_t main (void)
{
printf ("1str - global:.........%d\n", GlobalVar_g);
GeneralConfig_block:
{
printf ("2str - GeneralConfig:..%d\n", GlobalVar_g);
}
TimerConfig_block:
{
uint8_t GlobalVar_g = 77;
printf ("3str - TimerConfig:...%d\n", GlobalVar_g);
}
printf ("4str - global:.........%d\n", GlobalVar_g);
return 0;
}
Run this code: https://onlinegdb.com/DQzIvUjXw