Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPDI pin mode or MVIO mode fuses for AVR-DD #62

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions builder/fuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ def get_syscfg0_fuse(eesave, pin, uart):
rstpin_bit = 1
else:
rstpin_bit = 1
return 0xC0 | rstpin_bit << 3 | eesave_bit
if ("dd" in board.get("build.mcu").lower()):
if pin == "gpio":
updipin_bit = 0
else:
updipin_bit = 1
else:
updipin_bit = 0
return 0xC0 | updipin_bit << 4 | rstpin_bit << 3 | eesave_bit

elif core == "megatinycore":
if pin == "gpio":
Expand All @@ -73,9 +80,9 @@ def get_syscfg0_fuse(eesave, pin, uart):
env.Exit(1)


# Handle AVR-DB's differently since these has MVIO pins
# Handle AVR-DB's and DD's differently since these has MVIO pins
def get_syscfg1_fuse(mvio):
if core == "dxcore" and ("db" in board.get("build.mcu").lower()):
if core == "dxcore" and ("db" or "dd" in board.get("build.mcu").lower()):
if(mvio == "yes"):
return 0x0E
else:
Expand Down Expand Up @@ -152,7 +159,7 @@ def calculate_fuses(board_config, predefined_fuses):
print("Oscillator = %s" % oscillator)
print("BOD level = %s" % bod)
print("Save EEPROM = %s" % eesave)
if core == "dxcore" and "db" in board.get("build.mcu").lower():
if core == "dxcore" and ("db" or "dd" in board.get("build.mcu").lower()):
print("MVIO enable = %s" % mvio)
print("%s = %s" % (
"Reset pin mode" if core in ("MegaCoreX", "dxcore") else "UPDI pin mode", pin))
Expand Down