mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
efuse: Adds feature for efuse table, it can accept aliases in comments
DIS_TWAI, EFUSE_BLK0, 46, 1, [DIS_CAN DIS_CAN_123] Represents whether TWAI function ...
This commit is contained in:
parent
987fd3208a
commit
9eed575764
@ -261,7 +261,11 @@ class FuseTable(list):
|
||||
last_field_name = ''
|
||||
for p in self:
|
||||
if (p.field_name != last_field_name):
|
||||
rows += ['extern const esp_efuse_desc_t* ' + 'ESP_EFUSE_' + p.field_name.replace('.', '_') + '[];']
|
||||
name = 'ESP_EFUSE_' + p.field_name.replace('.', '_')
|
||||
rows += ['extern const esp_efuse_desc_t* ' + name + '[];']
|
||||
for alt_name in p.get_alt_names():
|
||||
alt_name = 'ESP_EFUSE_' + alt_name.replace('.', '_')
|
||||
rows += ['#define ' + alt_name + ' ' + name]
|
||||
last_field_name = p.field_name
|
||||
|
||||
rows += ['',
|
||||
@ -434,6 +438,12 @@ class FuseDefinition(object):
|
||||
str(self.bit_start),
|
||||
str(self.get_bit_count()) + '}, \t // ' + self.comment])
|
||||
|
||||
def get_alt_names(self):
|
||||
result = re.search(r'\[(.*?)\]', self.comment)
|
||||
if result:
|
||||
return result.group(1).split()
|
||||
return []
|
||||
|
||||
|
||||
def process_input_file(file, type_table):
|
||||
status('Parsing efuse CSV input file ' + file.name + ' ...')
|
||||
|
Loading…
Reference in New Issue
Block a user