#!/bin/bash # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2012-2024 Scott Penrose and WII5 Buoy contributors # # This file is part of WII5 Buoy firmware. # See LICENSE for full terms. # Burn WII5 application + bootloader via ICSP. # See http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega2560 # lfuse 0xff - external oscillator # hfuse 0xd8 # efuse 0xfd - BOD Level 1 = 2.7V : "${WII5_AVRDUDE:=avrdude}" FULL_HEX=wii5_buoy_latest.hex CONFIGFILE=./avrdude.conf BOOT_HEX=optiboot_flash_atmega2560_UART0_230400_11059200L_BIGBOOT.hex "$WII5_AVRDUDE" \ -C"$CONFIGFILE" -v \ -v \ -patmega2560 \ -cstk500v2 \ -Pusb \ -Uflash:w:"$FULL_HEX":i \ -Uboot:w:"$BOOT_HEX":i \ -Ulock:w:0