From fcb7c56b8d90db6ddc66712b44f557f98d43b2b8 Mon Sep 17 00:00:00 2001 From: Jussi Vestman Date: Sat, 23 Sep 2023 18:34:28 +0300 Subject: [PATCH] Fixed tests for KiCad 7 libraries --- arduino_generator.py | 12 ++++++------ generator.py | 4 ++-- tests/arduino-nano.py | 8 ++++---- tests/arduino-nano.yml | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arduino_generator.py b/arduino_generator.py index 70b369d..a288370 100644 --- a/arduino_generator.py +++ b/arduino_generator.py @@ -38,7 +38,7 @@ def generate_atmega328p(args): U1['VCC'] += Net.fetch('+5V') U1['AVCC'] += Net.fetch('+5V') U1['GND'] += Net.fetch('GND') -U1['~{RESET}/PC6'] & R('10k') & Net.fetch('{mcurail}') +U1['~{{RESET}}/PC6'] & R('10k') & Net.fetch('{mcurail}') {crystal} # Serial communications U1['PD1'] += Net.fetch('tx') @@ -109,7 +109,7 @@ def generate_icsp(): ICSP_CONN[2] += Net.fetch('+5V') ICSP_CONN[3] += U1['PB5'] ICSP_CONN[4] += U1['PB3'] -ICSP_CONN[5] += U1['~RESET~/PC6'] +ICSP_CONN[5] += U1['~{RESET}/PC6'] ICSP_CONN[6] += Net.fetch('GND') ''' @@ -118,7 +118,7 @@ def generate_arduino_reset_button(): """Generate reset button""" return ''' SW_RESET = Part('Switch', 'SW_Push', footprint="Button_Switch_SMD:SW_SPST_B3U-1000P") -SW_RESET[1] += U1['~RESET~/PC6'] +SW_RESET[1] += U1['~{RESET}/PC6'] SW_RESET[2] += Net.fetch('GND') ''' @@ -126,7 +126,7 @@ def generate_arduino_ftdi_reset(args): """Generate connection to FTDI header reset""" requirements.add(generate_c) return ''' -U1['~RESET~/PC6'] & C('100nF') & Net.fetch('RTS') +U1['~{RESET}/PC6'] & C('100nF') & Net.fetch('RTS') '''.format(**args) @@ -134,7 +134,7 @@ def generate_arduino_uno_r3_board_footprint(): """Generate Arduino Uno R3 board layout footprint""" return ''' BOARD = Part('MCU_Module', 'Arduino_Uno_R3', footprint='Module:Arduino_UNO_R3_WithMountingHoles') -BOARD['~RESET'] += U1['~RESET~/PC6'] +BOARD['~RESET'] += U1['~{RESET}/PC6'] BOARD['+5V'] += Net.fetch('+5V') BOARD['3V3'] += Net.fetch('+3V3') BOARD['GND'] += Net.fetch('GND') @@ -153,7 +153,7 @@ def generate_arduino_nano_v3_board_footprint(): """Generate Arduino Nano V3 board layout footprint""" return ''' BOARD = Part('MCU_Module', 'Arduino_Nano_v3.x', footprint='Module:Arduino_Nano') -BOARD['~RESET'] += U1['~RESET~/PC6'] +BOARD['~RESET'] += U1['~{RESET}/PC6'] BOARD['+5V'] += Net.fetch('+5V') BOARD['3V3'] += Net.fetch('+3V3') BOARD['GND'] += Net.fetch('GND') diff --git a/generator.py b/generator.py index 8f87dc2..bfe9616 100644 --- a/generator.py +++ b/generator.py @@ -159,12 +159,12 @@ def generate(args): if args.get('board_footprint', False) == 'Arduino Uno R3': code += generate_arduino_uno_r3_board_footprint() - if args['mcu'] in ['ATmega328P-PU', 'ATmega328P-AU', 'ATmega328P-MU']: + if args['mcu'] in ['ATmega328P-P', 'ATmega328P-A', 'ATmega328P-M']: code += generate_atmega_arduino_board_connections() if args.get('board_footprint', False) == 'Arduino Nano': code += generate_arduino_nano_v3_board_footprint() - if args['mcu'] in ['ATmega328P-PU', 'ATmega328P-AU', 'ATmega328P-MU']: + if args['mcu'] in ['ATmega328P-P', 'ATmega328P-A', 'ATmega328P-M']: code += generate_atmega_arduino_board_connections() if args.get('board_footprint', False) == 'Adafruit Feather': diff --git a/tests/arduino-nano.py b/tests/arduino-nano.py index 169ed24..b3174fa 100644 --- a/tests/arduino-nano.py +++ b/tests/arduino-nano.py @@ -59,10 +59,10 @@ def C(value): U1['VCC'] += Net.fetch('+5V') U1['AVCC'] += Net.fetch('+5V') U1['GND'] += Net.fetch('GND') -U1['~RESET~/PC6'] & R('10k') & Net.fetch('+5V') +U1['~{RESET}/PC6'] & R('10k') & Net.fetch('+5V') # Crystal -ATMEGA_XTAL = Part('Device','Resonator', footprint='Resonator_SMD_muRata_CSTxExxV-3Pin_3.0x1.1mm') +ATMEGA_XTAL = Part('Device','Resonator', footprint='Resonator_SMD_Murata_CSTxExxV-3Pin_3.0x1.1mm') U1['XTAL1/PB6'] += ATMEGA_XTAL[1] U1['XTAL2/PB7'] += ATMEGA_XTAL[3] ATMEGA_XTAL[2] += Net.fetch('GND') @@ -84,11 +84,11 @@ def C(value): ICSP_CONN[2] += Net.fetch('+5V') ICSP_CONN[3] += U1['PB5'] ICSP_CONN[4] += U1['PB3'] -ICSP_CONN[5] += U1['~RESET~/PC6'] +ICSP_CONN[5] += U1['~{RESET}/PC6'] ICSP_CONN[6] += Net.fetch('GND') SW_RESET = Part('Switch', 'SW_Push', footprint="Button_Switch_SMD:SW_SPST_B3U-1000P") -SW_RESET[1] += U1['~RESET~/PC6'] +SW_RESET[1] += U1['~{RESET}/PC6'] SW_RESET[2] += Net.fetch('GND') FUSE = Part('Device', 'Fuse', footprint='Fuse_1812_4532Metric') diff --git a/tests/arduino-nano.yml b/tests/arduino-nano.yml index f909aa3..c556015 100644 --- a/tests/arduino-nano.yml +++ b/tests/arduino-nano.yml @@ -15,7 +15,7 @@ icsp: true ina219: false led: false led_footprint: LED_SMD:LED_1206_3216Metric -mcu: ATmega328P-AU +mcu: ATmega328P-A mcu_footprint: Package_QFP:TQFP-32_7x7mm_P0.8mm mcurail: +5V onewire_connector: No Onewire connector