tools/gen-device-svd: move peripheral list to beginning
It's much easier to scan the source when the peripheral list is at the front. Go doesn't care about the order of declaration anyway.
Этот коммит содержится в:
родитель
e77a5af5d2
коммит
9b4a6dcc14
1 изменённых файлов: 6 добавлений и 6 удалений
|
@ -228,6 +228,12 @@ const (
|
||||||
out.write('\tIRQ_max = {} // Highest interrupt number on this device.\n'.format(intrMax))
|
out.write('\tIRQ_max = {} // Highest interrupt number on this device.\n'.format(intrMax))
|
||||||
out.write(')\n')
|
out.write(')\n')
|
||||||
|
|
||||||
|
# Define actual peripheral pointers.
|
||||||
|
out.write('\n// Peripherals.\nvar (\n')
|
||||||
|
for peripheral in device.peripherals:
|
||||||
|
out.write('\t{name} = (*{groupName}_Type)(unsafe.Pointer(uintptr(0x{baseAddress:x}))) // {description}\n'.format(**peripheral))
|
||||||
|
out.write(')\n')
|
||||||
|
|
||||||
# Define peripheral struct types.
|
# Define peripheral struct types.
|
||||||
for peripheral in device.peripherals:
|
for peripheral in device.peripherals:
|
||||||
if 'registers' not in peripheral:
|
if 'registers' not in peripheral:
|
||||||
|
@ -265,12 +271,6 @@ const (
|
||||||
address = register['address'] + 4
|
address = register['address'] + 4
|
||||||
out.write('}\n')
|
out.write('}\n')
|
||||||
|
|
||||||
# Define actual peripheral pointers.
|
|
||||||
out.write('\n// Peripherals.\nvar (\n')
|
|
||||||
for peripheral in device.peripherals:
|
|
||||||
out.write('\t{name} = (*{groupName}_Type)(unsafe.Pointer(uintptr(0x{baseAddress:x}))) // {description}\n'.format(**peripheral))
|
|
||||||
out.write(')\n')
|
|
||||||
|
|
||||||
# Define bitfields.
|
# Define bitfields.
|
||||||
for peripheral in device.peripherals:
|
for peripheral in device.peripherals:
|
||||||
if 'registers' not in peripheral:
|
if 'registers' not in peripheral:
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче