Browse Source

HAL_ChibiOS: simplify skyviper-v2450 config

remove unused peripherals
master
Andrew Tridgell 7 years ago
parent
commit
4ce0c2c827
  1. 16
      libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
  2. 23
      libraries/AP_HAL_ChibiOS/hwdef/skyviper-v2450/hwdef.dat

16
libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py

@ -828,6 +828,7 @@ def build_peripheral_list(): @@ -828,6 +828,7 @@ def build_peripheral_list():
def process_line(line):
'''process one line of pin definition file'''
global allpins
a = shlex.split(line)
# keep all config lines for later use
alllines.append(line)
@ -864,11 +865,24 @@ def process_line(line): @@ -864,11 +865,24 @@ def process_line(line):
if a[0] == 'SPIDEV':
spidev.append(a[1:])
if a[0] == 'undef':
print("Removing %s" % a[1])
config.pop(a[1], '')
bytype.pop(a[1],'')
bylabel.pop(a[1],'')
#also remove all occurences of defines in previous lines if any
for line in alllines:
for line in alllines[:]:
if line.startswith('define') and a[1] in line:
alllines.remove(line)
newpins = []
for pin in allpins:
if pin.type == a[1]:
continue
if pin.label == a[1]:
continue
if pin.portpin == a[1]:
continue
newpins.append(pin)
allpins = newpins
def process_file(filename):

23
libraries/AP_HAL_ChibiOS/hwdef/skyviper-v2450/hwdef.dat

@ -4,24 +4,35 @@ @@ -4,24 +4,35 @@
# start with fmuv3 base port
include ../fmuv3/hwdef.dat
# remove some unnecessary features from fmuv3
undef UART8
undef UART8_TX
undef UART8_RX
undef USART3
undef USART3_TX
undef USART3_RX
undef HAL_WITH_UAVCAN
undef IOMCU_UART
undef AP_FEATURE_SBUS_OUT
undef HAL_OS_FATFS_IO
undef AP_FEATURE_RTSCTS
undef HAL_WITH_RAMTRON
undef IOMCU_UART
UART_ORDER OTG1 UART4 USART2
# enable AP_Radio support
define HAL_RCINPUT_WITH_AP_RADIO 1
define HAL_GPIO_RADIO_RESET 1 // PB0 GPIO from FMU3
define HAL_GPIO_RADIO_IRQ 15 // PD15
# disable FRAM for storage
undef HAL_WITH_RAMTRON
# setup defines for ArduCopter config
define TOY_MODE_ENABLED ENABLED
define ARMING_DELAY_SEC 0
define LAND_START_ALT 700
define LAND_DETECTOR_ACCEL_MAX 2.0f
# disable IOMCU
undef IOMCU_UART
# support cypress and cc2500 radios
SPIDEV cypress SPI2 DEVID11 FRAM_CS MODE0 2*MHZ 2*MHZ
SPIDEV cc2500 SPI2 DEVID12 FRAM_CS MODE0 4*MHZ 4*MHZ

Loading…
Cancel
Save