Skip to content

Commit

Permalink
Fixed tests for KiCad 7 libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
jvestman committed Sep 23, 2023
1 parent e0c9ad1 commit fcb7c56
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions arduino_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
'''

Expand All @@ -118,23 +118,23 @@ 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')
'''

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)


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')
Expand All @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
8 changes: 4 additions & 4 deletions tests/arduino-nano.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion tests/arduino-nano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fcb7c56

Please sign in to comment.