refactor(lv_conf_internal): simplify the uppercase conversation added in aba10b0
Reaeted to #1989
This commit is contained in:
@@ -93,14 +93,13 @@ for i in fin.read().splitlines():
|
|||||||
|
|
||||||
if r:
|
if r:
|
||||||
line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros
|
line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros
|
||||||
line_upper = line.upper();
|
|
||||||
dr = re.sub('.*# *define', '', i, 1)
|
dr = re.sub('.*# *define', '', i, 1)
|
||||||
d = "# define " + dr
|
d = "# define " + dr
|
||||||
|
|
||||||
fout.write(
|
fout.write(
|
||||||
f'#ifndef {line}\n'
|
f'#ifndef {line}\n'
|
||||||
f'# ifdef CONFIG_{line_upper}\n'
|
f'# ifdef CONFIG_{line.upper()}\n'
|
||||||
f'# define {line} CONFIG_{line_upper}\n'
|
f'# define {line} CONFIG_{line.upper()}\n'
|
||||||
f'# else\n'
|
f'# else\n'
|
||||||
f'{d}\n'
|
f'{d}\n'
|
||||||
f'# endif\n'
|
f'# endif\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user