# frankenso changes ============================================
remove P_VOID1
remove P_VOID2
remove P_VOID3
remove P_VOID4
remove P_VOID5
remove P_VOID6

# need an option to allod cut layer (which i believe is turned off by default)
# add ../rusefi_lib/outlines/denso079721_outline.kicad_pcb

# brain board ===================================================

merge_net /PC10 /HD44780_CS
merge_net /PC12 /HD44780_RS
merge_net /PA10 /HD44780_D4
merge_net /PC11 /HD44780_D5
merge_net /PE9 /HD44780_D6
merge_net /PE11 /HD44780_D7

add ../brain_board/stm32f407_board.kicad_pcb 35.56 33.48736

# VR module 100 range ==============================================

add temp/cps_vrs_io_1.kicad_pcb -84 230.5
remove P104

# move_module R113 1 11

# power supply 150-160 range
add ../power_supply_kb1gtt/PWR_buck_12V_switcher.kicad_pcb 50 -130
remove P131
remove P132
remove P133

# HIP 160-180 range

merge_net /SCK /PB13
merge_net /SO /PB14
merge_net /SI /PB15
merge_net /CS /PE15
merge_net /INT/HLD /PE13 

add ../hip9011/DD_HIP9011.kicad_pcb -20 220
remove D162

remove P161
remove P162

# 8 pin connector
remove P164
remove C164
remove R165
# hold/test connector
remove P165

remove R165
remove R169
remove C161
remove P163

# not so sure is this has to be removed?
remove R164

# analog input 200-350 range =======================================

merge_net /OUT1 /PA1
merge_net /OUT2 /PA3
merge_net /OUT3 /PC3
merge_net /OUT4 /PC1
merge_net /OUT5 /PA0
merge_net /OUT6 /PC2

merge_net /OUT7 /PA4
merge_net /OUT8 /PA2
merge_net /OUT9 /PA6
merge_net /OUT10 /PA7
merge_net /OUT11 /PC4
merge_net /OUT12 /PC5


add ../adc_amp_divider.vertical12/adc_amp_divider.kicad_pcb 0 -160

# analog input board LED
remove LD200
remove R200

remove P201

# move_module M200 15 5


# SD & TTL module 350 range ========================================

merge_net /USART_TX /PC10
merge_net /USART_RX /PC11
merge_net /SPI_MISO /PB4
merge_net /SPI_MOSI /PB5
merge_net /SPI_SCK /PB3
merge_net /CS_SD_MODULE /PD4

add temp/mmc_usb_1.kicad_pcb 20 80
move_module P353 50 0

# SD/TTL module 3.3v LED
remove R354
remove D353

# SD/TTL module 5v LED
remove R353
remove D352
remove K351

remove P355

# SD/TTL right 10x2
remove P354

# SD/TTL left 10x2
remove P353


# injector driver 400 range ========================================

merge_net /INJ-11_5V /PB8
merge_net /INJ-12_5V /PB9

merge_net /INJ-09_5V /PE0
merge_net /INJ-10_5V /PE1

merge_net /INJ-07_5V /PE2
merge_net /INJ-08_5V /PE3

merge_net /INJ-05_5V /PE4
merge_net /INJ-06_5V /PE5

merge_net /INJ-03_5V /PE6
merge_net /INJ-04_5V /PC13


add ../1A_injector_12-channels/inj_12ch.kicad_pcb 110 -20

remove P402
remove P404
remove P405

# the output connector
remove P403



# CAN module - 470 range ===========================================
copy ../can_board/can_brd_1.kicad_pcb temp/can_brd_1.kicad_pcb
optimize temp/can_brd_1.kicad_pcb temp/can_brd_1.kicad_pcb

merge_net /CAN_TX /PB6
merge_net /CAN_RX /PB12

add temp/can_brd_1.kicad_pcb -70 -20

# CAN TX connector
remove P356

# CAN module connector
remove P471
# CAN module power LED
remove R471
remove D471

remove P473

move_module M470 6 -10


# hi-low driver 600 range ==========================================
copy ../hi-lo_driver/hi-lo.kicad_pcb temp/hi-lo.kicad_pcb
optimize temp/hi-lo.kicad_pcb temp/hi-lo.kicad_pcb

merge_net /H_IN1 /PE8
merge_net /H_IN2 /PE10
merge_net /H_IN3 /PE12
merge_net /H_IN4 /PE14
merge_net /H_IN5 /PC9
merge_net /H_IN6 /PC7

add temp/hi-lo.kicad_pcb 120 0

remove M601
remove P601
remove P602