diff --git a/builder/fuses.py b/builder/fuses.py index edda251..9eb7ca0 100644 --- a/builder/fuses.py +++ b/builder/fuses.py @@ -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": @@ -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: @@ -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))