HAL_ChibiOS: add HAL_WITH_SPI_xx defines for SPI devices

this allows us to avoid building drivers for SPI devices we don't
have, such as OSD
This commit is contained in:
Andrew Tridgell 2020-08-31 14:56:52 +10:00
parent 17173871a4
commit 491e82159c

View File

@ -908,7 +908,9 @@ def write_SPI_table(f):
mode, lowspeed, highspeed))
devlist.append('HAL_SPI_DEVICE%u' % devidx)
f.write('#define HAL_SPI_DEVICE_LIST %s\n\n' % ','.join(devlist))
for dev in spidev:
f.write("#define HAL_WITH_SPI_%s 1\n" % dev[0].upper().replace("-","_"))
f.write("\n")
def write_SPI_config(f):
'''write SPI config defines'''