Compare commits
7 Commits
8f16e303db
...
bf4636d994
Author | SHA1 | Date |
---|---|---|
jakeg00dwin | bf4636d994 | |
jakeg00dwin | f4d1ec92c7 | |
jakeg00dwin | 37c1d3ad0f | |
jakeg00dwin | 35ae117bf3 | |
jakeg00dwin | 571cf97afe | |
jakeg00dwin | ebf3610388 | |
jakeg00dwin | 236f821f78 |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,54 @@
|
||||||
|
# PowerShell script to flash a precompiled HEX file via avrdude.exe with a USBasp programmer
|
||||||
|
|
||||||
|
# Path to avrdude.exe
|
||||||
|
# $AvrdudePath = "C:\path\to\avrdude.exe"
|
||||||
|
$AvrdudePath = "avrdude.exe"
|
||||||
|
|
||||||
|
|
||||||
|
# Path to the USBasp configuration file (avrdude.conf)
|
||||||
|
$AvrdudeConf = "avrdude.conf"
|
||||||
|
|
||||||
|
# Path to the HEX file to be flashed
|
||||||
|
$HexFile = "pre_built\atiny13_4-8.hex"
|
||||||
|
|
||||||
|
# USBasp programmer options
|
||||||
|
$ProgrammerOptions = "-c usbasp"
|
||||||
|
|
||||||
|
# Microcontroller options (replace with the appropriate values for your microcontroller)
|
||||||
|
$MCU = "-p attiny13"
|
||||||
|
$BaudRate = "-B 10"
|
||||||
|
|
||||||
|
# Check if avrdude.exe exists
|
||||||
|
if (-not (Test-Path $AvrdudePath -PathType Leaf)) {
|
||||||
|
Write-Error "Error: avrdude.exe not found. Please set AvrdudePath in the script."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if the avrdude configuration file exists
|
||||||
|
if (-not (Test-Path $AvrdudeConf -PathType Leaf)) {
|
||||||
|
Write-Error "Error: avrdude.conf not found. Please set AvrdudeConf in the script."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if the HEX file exists
|
||||||
|
if (-not (Test-Path $HexFile -PathType Leaf)) {
|
||||||
|
Write-Error "Error: HEX file not found. Please set HexFile in the script."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Build avrdude command
|
||||||
|
$AvrdudeCommand = "$AvrdudePath -C $AvrdudeConf $ProgrammerOptions $MCU $BaudRate -U flash:w:$HexFile"
|
||||||
|
|
||||||
|
# Run avrdude command
|
||||||
|
Write-Host "Flashing HEX file..."
|
||||||
|
Invoke-Expression $AvrdudeCommand
|
||||||
|
|
||||||
|
# Check avrdude exit code
|
||||||
|
if ($LASTEXITCODE -eq 0) {
|
||||||
|
Write-Host "Flashing completed successfully."
|
||||||
|
} else {
|
||||||
|
Write-Host "Flashing failed. Check avrdude output for details."
|
||||||
|
}
|
||||||
|
|
||||||
|
# Exit with avrdude exit code
|
||||||
|
exit $LASTEXITCODE
|
|
@ -0,0 +1,420 @@
|
||||||
|
/*
|
||||||
|
* FileName: *.c
|
||||||
|
* Date: 2023
|
||||||
|
* Descripton: Program for Atiny13A controllers, controls DPDT relays and
|
||||||
|
* has options to save settings in EEPROM.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MCU
|
||||||
|
#define MCU atiny13a
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef F_CPU
|
||||||
|
#define F_CPU 4800000UL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#include <avr/eeprom.h>
|
||||||
|
|
||||||
|
//These are just defined in case for compatability with Arduino
|
||||||
|
#ifndef HIGH
|
||||||
|
#define HIGH 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LOW
|
||||||
|
#define LOW 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef UINT8_MAX
|
||||||
|
#define UINT8_MAX 256
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//This is the bitpattern that should be at address 0x00
|
||||||
|
#define START_PATTERN 0xAA
|
||||||
|
#define END_PATTERN 0x55
|
||||||
|
|
||||||
|
//Addresses in the eeprom for the two bypasses
|
||||||
|
#define ROM_SP_ADR 0x0
|
||||||
|
#define ROM_BP1_ADR 0x1
|
||||||
|
#define ROM_BP2_ADR 0x2
|
||||||
|
#define ROM_EP_ADR 0x3
|
||||||
|
|
||||||
|
//Debounce check number.
|
||||||
|
#define MAX_CHECKS 10
|
||||||
|
|
||||||
|
// Define DISABLE_TEMPORARY_SWITCH to turn off the ability to hold
|
||||||
|
// the switch to temporarily engage/bypass.
|
||||||
|
//#define DISABLE_TEMPORARY_SWITCH
|
||||||
|
|
||||||
|
#define PIN_SW2 PINB3
|
||||||
|
#define PIN_BYPASS2 PB4
|
||||||
|
#define PIN_SW1 PINB2
|
||||||
|
#define PIN_BYPASS1 PB1
|
||||||
|
#define PIN_MUTE PB0
|
||||||
|
|
||||||
|
//The BLINK_QTY can be edited from 0-255 blinks
|
||||||
|
#define BLINK_QTY 2
|
||||||
|
#define BLINK_CNT 2 * BLINK_QTY
|
||||||
|
#define BLINK_DELAY 200
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*The timing of "ticks" is dependent on the AVR timer's counter register
|
||||||
|
* so for an 8bit register the maximum value is 256. Given we stick with
|
||||||
|
* a 1Mhz cpu frequency can use this formula to calculate the number of
|
||||||
|
* interrupts(timer overflows) per second:
|
||||||
|
*
|
||||||
|
* OVF_S = (F_CPU / DIV)/ (2^8)
|
||||||
|
* 61 = (1000000 / 64) / 256
|
||||||
|
*
|
||||||
|
* This is important because the ATiny13/A only have a single timer built into
|
||||||
|
* them.
|
||||||
|
*
|
||||||
|
* Ticks are used as our way of keep track of long button presses.
|
||||||
|
* */
|
||||||
|
#define LONG_PRESS_TICKS 60
|
||||||
|
|
||||||
|
|
||||||
|
/*A structure to hold the button info*/
|
||||||
|
typedef struct {
|
||||||
|
uint8_t is_pressed: 1;
|
||||||
|
uint8_t is_bypassed: 1;
|
||||||
|
uint8_t is_long_pressed: 1;
|
||||||
|
uint8_t timer_enabled: 1;
|
||||||
|
uint8_t pressed_ticks;
|
||||||
|
uint8_t input_pin;
|
||||||
|
uint8_t output_pin;
|
||||||
|
}btn_state;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ###############################
|
||||||
|
* Global Variables
|
||||||
|
* ###############################
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*Create two diffent instances of the button state structure*/
|
||||||
|
btn_state btn1;
|
||||||
|
btn_state btn2;
|
||||||
|
|
||||||
|
/*Some variables for managing the debouncing*/
|
||||||
|
volatile uint8_t debounced_state;
|
||||||
|
volatile uint8_t db_state[MAX_CHECKS];
|
||||||
|
volatile uint8_t idx;
|
||||||
|
|
||||||
|
volatile uint16_t tick_count;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ###############################
|
||||||
|
* FUNCTION PROTOTYPES
|
||||||
|
* ###############################
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void toggle_output(btn_state *b);
|
||||||
|
static inline void init_btn(btn_state *b, uint8_t input_pin, uint8_t output_pin);
|
||||||
|
static void clear_button_timer(btn_state *b);
|
||||||
|
static inline void start_button_timer(btn_state *b);
|
||||||
|
static inline void check_button_longpress(btn_state *b);
|
||||||
|
static void update_button_output(btn_state *b);
|
||||||
|
static void update_button_input(btn_state *b);
|
||||||
|
|
||||||
|
static inline void blink_bypass1(void);
|
||||||
|
static inline void blink_bypass2(void);
|
||||||
|
|
||||||
|
static inline void init_timer0();
|
||||||
|
static inline void debounce_switch();
|
||||||
|
/*
|
||||||
|
* ###############################
|
||||||
|
* SETUP AND LOOP
|
||||||
|
* ###############################
|
||||||
|
*/
|
||||||
|
void init_prog()
|
||||||
|
{
|
||||||
|
/*Set the debounced state to all high*/
|
||||||
|
debounced_state = 0xFF;
|
||||||
|
|
||||||
|
/*Configures the PINS for the input and output.*/
|
||||||
|
init_btn(&btn1, PIN_SW1, PIN_BYPASS1);
|
||||||
|
init_btn(&btn2, PIN_SW2, PIN_BYPASS2);
|
||||||
|
|
||||||
|
/*Wait 5ms for pull-up resistors voltage to become stable.*/
|
||||||
|
_delay_ms(5);
|
||||||
|
|
||||||
|
/*check if the eeprom has info. */
|
||||||
|
while(! eeprom_is_ready()) {} //Blocks until eeprom is ready.
|
||||||
|
|
||||||
|
//Checks against a bit pattern we defined to represent the start of data.
|
||||||
|
if(eeprom_read_byte((uint8_t *)ROM_SP_ADR) == START_PATTERN) {
|
||||||
|
//Reads the two bytes representing the two states.
|
||||||
|
btn1.is_bypassed = eeprom_read_byte((uint8_t *)ROM_BP1_ADR);
|
||||||
|
btn2.is_bypassed = eeprom_read_byte((uint8_t *)ROM_BP2_ADR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//otherwise we write the init values for the start pattern and bypass states.
|
||||||
|
eeprom_write_byte((uint8_t *)ROM_SP_ADR, START_PATTERN);
|
||||||
|
eeprom_write_byte((uint8_t *)ROM_BP1_ADR, 0x0);
|
||||||
|
eeprom_write_byte((uint8_t *)ROM_BP2_ADR, 0x0);
|
||||||
|
}
|
||||||
|
|
||||||
|
btn1.is_pressed = ((PINB & (1<<btn1.input_pin)) == 0);
|
||||||
|
btn2.is_pressed = ((PINB & (1<<btn2.input_pin)) == 0);
|
||||||
|
|
||||||
|
|
||||||
|
/*This is to read if the user wants to change the saved states.*/
|
||||||
|
/*Manually read the current switch state*/
|
||||||
|
if(btn1.is_pressed){
|
||||||
|
btn1.is_bypassed = ! btn1.is_bypassed;
|
||||||
|
eeprom_write_byte((uint8_t *)ROM_BP1_ADR, btn1.is_bypassed);
|
||||||
|
blink_bypass1();
|
||||||
|
}
|
||||||
|
if(btn2.is_pressed){
|
||||||
|
btn2.is_bypassed = ! btn2.is_bypassed;
|
||||||
|
eeprom_write_byte((uint8_t *)ROM_BP2_ADR, btn2.is_bypassed);
|
||||||
|
blink_bypass2();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(btn1.is_bypassed){PORTB |= (1<<btn1.output_pin);}
|
||||||
|
if(btn2.is_bypassed){PORTB |= (1<<btn2.output_pin);}
|
||||||
|
|
||||||
|
init_timer0();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
|
||||||
|
init_prog();
|
||||||
|
|
||||||
|
while(1){
|
||||||
|
update_button_output(&btn1);
|
||||||
|
update_button_output(&btn2);
|
||||||
|
|
||||||
|
update_button_input(&btn1);
|
||||||
|
update_button_input(&btn2);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ###############################
|
||||||
|
* FUNCTION DEFs
|
||||||
|
* ###############################
|
||||||
|
*/
|
||||||
|
|
||||||
|
void inf_blink_test(){
|
||||||
|
DDRB |= (1<<PB3);
|
||||||
|
while(1){
|
||||||
|
PORTB ^= (1<<PB3);
|
||||||
|
_delay_ms(250);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Made heavy use of static inline functions to improve readability.
|
||||||
|
|
||||||
|
static inline void blink_bypass1(void)
|
||||||
|
{
|
||||||
|
for(uint8_t i = 0; i < BLINK_CNT; i++) {
|
||||||
|
PORTB ^= (1<<PIN_BYPASS1);
|
||||||
|
_delay_ms(BLINK_DELAY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void blink_bypass2(void)
|
||||||
|
{
|
||||||
|
for(uint8_t i = 0; i < BLINK_CNT; i++) {
|
||||||
|
PORTB ^= (1<<PIN_BYPASS2);
|
||||||
|
_delay_ms(BLINK_DELAY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ############################
|
||||||
|
* BUTTON methods
|
||||||
|
* ############################
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*This is kinda like our button constructor*/
|
||||||
|
static void init_btn(btn_state *b, uint8_t input_pin, uint8_t output_pin)
|
||||||
|
{
|
||||||
|
b->is_long_pressed = 0;
|
||||||
|
b->is_pressed = 0;
|
||||||
|
b->is_bypassed = 0;
|
||||||
|
b->pressed_ticks = 0;
|
||||||
|
b->timer_enabled = 0;
|
||||||
|
b->input_pin = input_pin;
|
||||||
|
b->output_pin = output_pin;
|
||||||
|
|
||||||
|
/*Configure the buttons inputs and outputs*/
|
||||||
|
DDRB &= ~(1<<b->input_pin);
|
||||||
|
PORTB |= (1<<b->input_pin);
|
||||||
|
|
||||||
|
DDRB |= (1<<b->output_pin);
|
||||||
|
PORTB &= ~(1<<b->output_pin);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*This is the fancy function to toggle output pins*/
|
||||||
|
static void toggle_output(btn_state *b)
|
||||||
|
{
|
||||||
|
if(!b->is_bypassed){
|
||||||
|
b->is_bypassed = 1;
|
||||||
|
PORTB |= (1<<b->output_pin);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
b->is_bypassed = 0;
|
||||||
|
PORTB &= ~(1<<b->output_pin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void clear_button_timer(btn_state *b)
|
||||||
|
{
|
||||||
|
b->timer_enabled = 0;
|
||||||
|
b->is_long_pressed = 0;
|
||||||
|
b->pressed_ticks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void start_button_timer(btn_state *b)
|
||||||
|
{
|
||||||
|
clear_button_timer(b);
|
||||||
|
b->timer_enabled = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void check_button_longpress(btn_state *b)
|
||||||
|
{
|
||||||
|
if(b->pressed_ticks >= LONG_PRESS_TICKS) {
|
||||||
|
b->is_long_pressed = 1;
|
||||||
|
b->timer_enabled = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void update_button_input(btn_state *b)
|
||||||
|
{
|
||||||
|
/*Check from the global debounced port input*/
|
||||||
|
|
||||||
|
/*check for pin HIGH*/
|
||||||
|
if(debounced_state & (1<<b->input_pin)) {
|
||||||
|
b->is_pressed = 0;
|
||||||
|
}
|
||||||
|
/*otherwise assume pin LOW*/
|
||||||
|
else{
|
||||||
|
b->is_pressed = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void update_button_output(btn_state *b)
|
||||||
|
{
|
||||||
|
/*If the button is actually pressed.*/
|
||||||
|
if(b->is_pressed){
|
||||||
|
|
||||||
|
/*If this is a new event.*/
|
||||||
|
if(!b->is_long_pressed && !b->timer_enabled){
|
||||||
|
/*Then start the timer and update the output*/
|
||||||
|
toggle_output(b);
|
||||||
|
start_button_timer(b);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*If the timer is already going.*/
|
||||||
|
else if(b->timer_enabled){
|
||||||
|
/*Then just check if it's hit the threshold.*/
|
||||||
|
check_button_longpress(b);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Else the button was realeased*/
|
||||||
|
else if(!b->is_pressed){
|
||||||
|
/*If the button was released on a long press.*/
|
||||||
|
if(b->is_long_pressed){
|
||||||
|
toggle_output(b);
|
||||||
|
}
|
||||||
|
clear_button_timer(b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ############################
|
||||||
|
* DEBOUNCING CODE
|
||||||
|
* ############################
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* INPUT: The port to check.
|
||||||
|
* OUTPUT: None
|
||||||
|
* DESCRIPTION: Updates the global debounced state. This function
|
||||||
|
* should be called in a ISR a set rate using the hardware timer.
|
||||||
|
*/
|
||||||
|
static inline void debounce_switch() {
|
||||||
|
uint8_t i, j;
|
||||||
|
db_state[idx] = PINB & 0xFF;
|
||||||
|
idx+=1;
|
||||||
|
j = 0xff;
|
||||||
|
/*Loop through a number of checks*/
|
||||||
|
for(i = 0; i < MAX_CHECKS; i++) {
|
||||||
|
j = j & db_state[i];
|
||||||
|
}
|
||||||
|
debounced_state = j;
|
||||||
|
|
||||||
|
if(idx >= MAX_CHECKS) {
|
||||||
|
idx = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*Setup the timer0 on the AVR*/
|
||||||
|
static inline void init_timer0() {
|
||||||
|
/*Zero out the tick_count var*/
|
||||||
|
tick_count = 0;
|
||||||
|
|
||||||
|
/*config to normal mode.*/
|
||||||
|
TCCR0A = 0x00; //stop timer
|
||||||
|
TCCR0B = 0x00; //zero timer
|
||||||
|
|
||||||
|
/*set prescaler*/
|
||||||
|
//TCCR0B |= (1<<CS00)|(1<<CS02);
|
||||||
|
TCCR0B |= (1<<CS01)|(1<<CS00);
|
||||||
|
//TCCR0B |= (1<<CS01);
|
||||||
|
|
||||||
|
|
||||||
|
/*Enable global interrupts*/
|
||||||
|
sei();
|
||||||
|
|
||||||
|
/*Enabling timer0 interrupt*/
|
||||||
|
TCNT0 = 0;
|
||||||
|
TIMSK0 |= (1<<TOIE0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//ISR(TIMER0_OVF_vect)
|
||||||
|
|
||||||
|
/*The interrupt service routine for the timer0*/
|
||||||
|
ISR(TIM0_OVF_vect)
|
||||||
|
{
|
||||||
|
/*Disable global interrupts*/
|
||||||
|
cli();
|
||||||
|
|
||||||
|
/*Update the tick_count*/
|
||||||
|
if(btn1.timer_enabled && btn1.pressed_ticks <= UINT8_MAX){
|
||||||
|
btn1.pressed_ticks += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(btn2.timer_enabled && btn2.pressed_ticks <= UINT8_MAX){
|
||||||
|
btn2.pressed_ticks += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Check the state of the switches*/
|
||||||
|
debounce_switch();
|
||||||
|
|
||||||
|
/*Re-Enable global interrupts*/
|
||||||
|
sei();
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
# Author: Jake Goodwin
|
||||||
|
# DATE: 2023-12-07
|
||||||
|
# Descripion: A simple makefile for building and flashing hex files
|
||||||
|
|
||||||
|
# Makefile for ATtiny13A
|
||||||
|
|
||||||
|
# Compiler
|
||||||
|
CC = avr-gcc
|
||||||
|
|
||||||
|
#Default cpu frequency is 9.8Mhz, 4.8 gives us less power consumption
|
||||||
|
#F_CPU = 4800000UL
|
||||||
|
F_CPU = 9800000UL
|
||||||
|
MCU = attiny13a
|
||||||
|
|
||||||
|
# Flags
|
||||||
|
CFLAGS = -g -Os -mmcu=$(MCU) -DF_CPU=$(F_CPU)
|
||||||
|
LDFLAGS = -Wl,-Map,$(TARGET).map
|
||||||
|
|
||||||
|
# Source files
|
||||||
|
SRC = main.c
|
||||||
|
|
||||||
|
# Object files
|
||||||
|
OBJ = $(SRC:.c=.o)
|
||||||
|
|
||||||
|
# Target HEX file
|
||||||
|
TARGET = main
|
||||||
|
|
||||||
|
# Flashing options
|
||||||
|
AVRDUDE = avrdude
|
||||||
|
AVRDUDE_PROGRAMMER = -c usbasp
|
||||||
|
BUADRATE = -B 125kHz
|
||||||
|
AVRDUDE_PORT = -P /dev/ttyUSB0
|
||||||
|
AVRDUDE_MCU = -p $(MCU)
|
||||||
|
|
||||||
|
|
||||||
|
# Compile and generate HEX file
|
||||||
|
all: $(TARGET).hex
|
||||||
|
|
||||||
|
$(TARGET).hex: $(TARGET).elf
|
||||||
|
avr-objcopy -j .text -j .data -O ihex $< $@
|
||||||
|
|
||||||
|
$(TARGET).elf: $(OBJ)
|
||||||
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
size: $(TARGET).o
|
||||||
|
avr-size --mcu=$(MCU) -t ./$(TARGET).o
|
||||||
|
flash_defualt_fuses:
|
||||||
|
$(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U lfuse:w:0x6A:m -U hfuse:w:0xFF:m -U lock:w:0xFF:m
|
||||||
|
flash_slow_fuse:
|
||||||
|
$(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U lfuse:w:0x69:m -U hfuse:w:0xFF:m -U lock:w:0xFF:m
|
||||||
|
flash: $(TARGET).hex
|
||||||
|
$(AVRDUDE) $(AVRDUDE_PROGRAMMER) $(AVRDUDE_PORT) $(AVRDUDE_MCU) $(BUADRATE) -U flash:w:$(TARGET).hex:i
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJ) $(TARGET).elf $(TARGET).hex $(TARGET).map
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
:1000000009C016C015C067C113C012C011C010C00E
|
||||||
|
:100010000FC00EC011241FBECFE9CDBF20E0A0E667
|
||||||
|
:10002000B0E001C01D92A637B207E1F79ED1DFC153
|
||||||
|
:10003000E7CFFC0180811182887F877F8083628384
|
||||||
|
:10004000438397B321E030E0A90101C0440F6A95D2
|
||||||
|
:10005000EAF7842F8095892387BB48B3C9010280C2
|
||||||
|
:1000600002C0880F991F0A94E2F7842B88BB47B31C
|
||||||
|
:10007000C901038002C0880F991F0A94E2F7842BFC
|
||||||
|
:1000800087BB88B3038002C0220F331F0A94E2F7B4
|
||||||
|
:100090002095282328BB0895FC019081338191FD90
|
||||||
|
:1000A0000BC09260908328B381E090E001C0880F7C
|
||||||
|
:1000B0003A95EAF7822B0BC09D7F908328B381E0AD
|
||||||
|
:1000C00090E001C0880F3A95EAF78095822388BBBB
|
||||||
|
:1000D0000895CF93DF93EC01888180FF13C0982FA0
|
||||||
|
:1000E0009C7039F4CE01D8DF888119828B7F8860BB
|
||||||
|
:1000F00007C083FF10C099819C3368F08460877FBC
|
||||||
|
:10010000888309C082FF02C0CE01C6DF8881877F55
|
||||||
|
:100110008B7F88831982DF91CF9108958FEF809331
|
||||||
|
:10012000750041E062E081E790E083DF44E063E056
|
||||||
|
:100130008AE690E07EDF8FE697E10197F1F700C055
|
||||||
|
:100140000000E199FECF80E090E03DD18A3A99F439
|
||||||
|
:1001500081E090E038D19091710080FB91F990930B
|
||||||
|
:10016000710082E090E02FD190916A0080FB91F9BC
|
||||||
|
:1001700090936A000CC06AEA80E090E02BD160E0C6
|
||||||
|
:1001800081E090E027D160E082E090E023D186B367
|
||||||
|
:1001900090E00090730002C0959587950A94E2F76D
|
||||||
|
:1001A0008170992721E082272091710080FB20F93E
|
||||||
|
:1001B0002093710086B390E000906C0002C095958A
|
||||||
|
:1001C00087950A94E2F78170992731E0832790910F
|
||||||
|
:1001D0006A0080FB90F990936A0020FD05C0809131
|
||||||
|
:1001E0006A0080FF3AC01DC021FB662760F981E0EC
|
||||||
|
:1001F000682760FB21F92093710081E090E0EAD04C
|
||||||
|
:1002000084E022E098B3922798BB4FEF9DEE32E056
|
||||||
|
:10021000415090403040E1F700C00000815091F71C
|
||||||
|
:10022000DECF81FB662760F991E0692760FB81F9E9
|
||||||
|
:1002300080936A0082E090E0CDD084E020E198B322
|
||||||
|
:10024000922798BB4FEF9DEE32E0415090403040F6
|
||||||
|
:10025000E1F700C00000815091F78091710081FFAB
|
||||||
|
:100260000CC028B381E090E00090740002C0880FB9
|
||||||
|
:10027000991F0A94E2F7822B88BB80916A0081FF64
|
||||||
|
:100280000CC028B381E090E000906D0002C0880FA0
|
||||||
|
:10029000991F0A94E2F7822B88BB10926F0010928C
|
||||||
|
:1002A0006E001FBC13BE83B7836083BF789412BEF9
|
||||||
|
:1002B00089B7826089BF0895BB9A98E088B389277F
|
||||||
|
:1002C00088BB2FE739EA83E0215030408040E1F7D6
|
||||||
|
:1002D00000C00000F3CF1F920F920FB60F921124AF
|
||||||
|
:1002E0002F933F938F939F93EF93FF93F894809175
|
||||||
|
:1002F000710083FF05C0809172008F5F8093720050
|
||||||
|
:1003000080916A0083FF05C080916B008F5F8093AE
|
||||||
|
:100310006B00E0917000F0E086B3E05AFF4F8083FD
|
||||||
|
:10032000809170008F5F8093700080E090E02FEFED
|
||||||
|
:10033000FC01E05AFF4F3081232301968A3091055A
|
||||||
|
:10034000B9F720937500809170008A3010F01092F8
|
||||||
|
:1003500070007894FF91EF919F918F913F912F9131
|
||||||
|
:100360000F900FBE0F901F901895D8DE81E790E098
|
||||||
|
:10037000B0DE8AE690E0ADDE2091750030E00090BE
|
||||||
|
:10038000730002C0359527950A94E2F780917100B9
|
||||||
|
:1003900020FF02C08E7F01C0816080937100209198
|
||||||
|
:1003A000750030E000906C0002C0359527950A94E6
|
||||||
|
:1003B000E2F780916A0020FF02C08E7F01C0816059
|
||||||
|
:1003C00080936A00D3CFE199FECF8EBBE09A992744
|
||||||
|
:1003D0008DB30895262FE199FECF1CBA8EBB2DBB9D
|
||||||
|
:1003E0000FB6F894E29AE19A0FBE01960895F89438
|
||||||
|
:0203F000FFCF3D
|
||||||
|
:00000001FF
|
|
@ -0,0 +1,65 @@
|
||||||
|
:1000000009C016C015C067C113C012C011C010C00E
|
||||||
|
:100010000FC00EC011241FBECFE9CDBF20E0A0E667
|
||||||
|
:10002000B0E001C01D92A637B207E1F79ED1DFC153
|
||||||
|
:10003000E7CFFC0180811182887F877F8083628384
|
||||||
|
:10004000438397B321E030E0A90101C0440F6A95D2
|
||||||
|
:10005000EAF7842F8095892387BB48B3C9010280C2
|
||||||
|
:1000600002C0880F991F0A94E2F7842B88BB47B31C
|
||||||
|
:10007000C901038002C0880F991F0A94E2F7842BFC
|
||||||
|
:1000800087BB88B3038002C0220F331F0A94E2F7B4
|
||||||
|
:100090002095282328BB0895FC019081338191FD90
|
||||||
|
:1000A0000BC09260908328B381E090E001C0880F7C
|
||||||
|
:1000B0003A95EAF7822B0BC09D7F908328B381E0AD
|
||||||
|
:1000C00090E001C0880F3A95EAF78095822388BBBB
|
||||||
|
:1000D0000895CF93DF93EC01888180FF13C0982FA0
|
||||||
|
:1000E0009C7039F4CE01D8DF888119828B7F8860BB
|
||||||
|
:1000F00007C083FF10C099819C3368F08460877FBC
|
||||||
|
:10010000888309C082FF02C0CE01C6DF8881877F55
|
||||||
|
:100110008B7F88831982DF91CF9108958FEF809331
|
||||||
|
:10012000750041E062E081E790E083DF44E063E056
|
||||||
|
:100130008AE690E07EDF89ED9FE20197F1F700C04B
|
||||||
|
:100140000000E199FECF80E090E03DD18A3A99F439
|
||||||
|
:1001500081E090E038D19091710080FB91F990930B
|
||||||
|
:10016000710082E090E02FD190916A0080FB91F9BC
|
||||||
|
:1001700090936A000CC06AEA80E090E02BD160E0C6
|
||||||
|
:1001800081E090E027D160E082E090E023D186B367
|
||||||
|
:1001900090E00090730002C0959587950A94E2F76D
|
||||||
|
:1001A0008170992721E082272091710080FB20F93E
|
||||||
|
:1001B0002093710086B390E000906C0002C095958A
|
||||||
|
:1001C00087950A94E2F78170992731E0832790910F
|
||||||
|
:1001D0006A0080FB90F990936A0020FD05C0809131
|
||||||
|
:1001E0006A0080FF3AC01DC021FB662760F981E0EC
|
||||||
|
:1001F000682760FB21F92093710081E090E0EAD04C
|
||||||
|
:1002000084E022E098B3922798BB4FE39BEF35E060
|
||||||
|
:10021000415090403040E1F700C00000815091F71C
|
||||||
|
:10022000DECF81FB662760F991E0692760FB81F9E9
|
||||||
|
:1002300080936A0082E090E0CDD084E020E198B322
|
||||||
|
:10024000922798BB4FE39BEF35E041509040304000
|
||||||
|
:10025000E1F700C00000815091F78091710081FFAB
|
||||||
|
:100260000CC028B381E090E00090740002C0880FB9
|
||||||
|
:10027000991F0A94E2F7822B88BB80916A0081FF64
|
||||||
|
:100280000CC028B381E090E000906D0002C0880FA0
|
||||||
|
:10029000991F0A94E2F7822B88BB10926F0010928C
|
||||||
|
:1002A0006E001FBC13BE83B7836083BF789412BEF9
|
||||||
|
:1002B00089B7826089BF0895BB9A98E088B389277F
|
||||||
|
:1002C00088BB2FE03AE787E0215030408040E1F7DB
|
||||||
|
:1002D00000C00000F3CF1F920F920FB60F921124AF
|
||||||
|
:1002E0002F933F938F939F93EF93FF93F894809175
|
||||||
|
:1002F000710083FF05C0809172008F5F8093720050
|
||||||
|
:1003000080916A0083FF05C080916B008F5F8093AE
|
||||||
|
:100310006B00E0917000F0E086B3E05AFF4F8083FD
|
||||||
|
:10032000809170008F5F8093700080E090E02FEFED
|
||||||
|
:10033000FC01E05AFF4F3081232301968A3091055A
|
||||||
|
:10034000B9F720937500809170008A3010F01092F8
|
||||||
|
:1003500070007894FF91EF919F918F913F912F9131
|
||||||
|
:100360000F900FBE0F901F901895D8DE81E790E098
|
||||||
|
:10037000B0DE8AE690E0ADDE2091750030E00090BE
|
||||||
|
:10038000730002C0359527950A94E2F780917100B9
|
||||||
|
:1003900020FF02C08E7F01C0816080937100209198
|
||||||
|
:1003A000750030E000906C0002C0359527950A94E6
|
||||||
|
:1003B000E2F780916A0020FF02C08E7F01C0816059
|
||||||
|
:1003C00080936A00D3CFE199FECF8EBBE09A992744
|
||||||
|
:1003D0008DB30895262FE199FECF1CBA8EBB2DBB9D
|
||||||
|
:1003E0000FB6F894E29AE19A0FBE01960895F89438
|
||||||
|
:0203F000FFCF3D
|
||||||
|
:00000001FF
|
|
@ -0,0 +1,65 @@
|
||||||
|
:1000000009C016C015C067C113C012C011C010C00E
|
||||||
|
:100010000FC00EC011241FBECFE9CDBF20E0A0E667
|
||||||
|
:10002000B0E001C01D92A637B207E1F79ED1DFC153
|
||||||
|
:10003000E7CFFC0180811182887F877F8083628384
|
||||||
|
:10004000438397B321E030E0A90101C0440F6A95D2
|
||||||
|
:10005000EAF7842F8095892387BB48B3C9010280C2
|
||||||
|
:1000600002C0880F991F0A94E2F7842B88BB47B31C
|
||||||
|
:10007000C901038002C0880F991F0A94E2F7842BFC
|
||||||
|
:1000800087BB88B3038002C0220F331F0A94E2F7B4
|
||||||
|
:100090002095282328BB0895FC019081338191FD90
|
||||||
|
:1000A0000BC09260908328B381E090E001C0880F7C
|
||||||
|
:1000B0003A95EAF7822B0BC09D7F908328B381E0AD
|
||||||
|
:1000C00090E001C0880F3A95EAF78095822388BBBB
|
||||||
|
:1000D0000895CF93DF93EC01888180FF13C0982FA0
|
||||||
|
:1000E0009C7039F4CE01D8DF888119828B7F8860BB
|
||||||
|
:1000F00007C083FF10C099819C3368F08460877FBC
|
||||||
|
:10010000888309C082FF02C0CE01C6DF8881877F55
|
||||||
|
:100110008B7F88831982DF91CF9108958FEF809331
|
||||||
|
:10012000750041E062E081E790E083DF44E063E056
|
||||||
|
:100130008AE690E07EDF8FE697E10197F1F700C055
|
||||||
|
:100140000000E199FECF80E090E03DD18A3A99F439
|
||||||
|
:1001500081E090E038D19091710080FB91F990930B
|
||||||
|
:10016000710082E090E02FD190916A0080FB91F9BC
|
||||||
|
:1001700090936A000CC06AEA80E090E02BD160E0C6
|
||||||
|
:1001800081E090E027D160E082E090E023D186B367
|
||||||
|
:1001900090E00090730002C0959587950A94E2F76D
|
||||||
|
:1001A0008170992721E082272091710080FB20F93E
|
||||||
|
:1001B0002093710086B390E000906C0002C095958A
|
||||||
|
:1001C00087950A94E2F78170992731E0832790910F
|
||||||
|
:1001D0006A0080FB90F990936A0020FD05C0809131
|
||||||
|
:1001E0006A0080FF3AC01DC021FB662760F981E0EC
|
||||||
|
:1001F000682760FB21F92093710081E090E0EAD04C
|
||||||
|
:1002000084E022E098B3922798BB4FEF9DEE32E056
|
||||||
|
:10021000415090403040E1F700C00000815091F71C
|
||||||
|
:10022000DECF81FB662760F991E0692760FB81F9E9
|
||||||
|
:1002300080936A0082E090E0CDD084E020E198B322
|
||||||
|
:10024000922798BB4FEF9DEE32E0415090403040F6
|
||||||
|
:10025000E1F700C00000815091F78091710081FFAB
|
||||||
|
:100260000CC028B381E090E00090740002C0880FB9
|
||||||
|
:10027000991F0A94E2F7822B88BB80916A0081FF64
|
||||||
|
:100280000CC028B381E090E000906D0002C0880FA0
|
||||||
|
:10029000991F0A94E2F7822B88BB10926F0010928C
|
||||||
|
:1002A0006E001FBC13BE83B7836083BF789412BEF9
|
||||||
|
:1002B00089B7826089BF0895BB9A98E088B389277F
|
||||||
|
:1002C00088BB2FE739EA83E0215030408040E1F7D6
|
||||||
|
:1002D00000C00000F3CF1F920F920FB60F921124AF
|
||||||
|
:1002E0002F933F938F939F93EF93FF93F894809175
|
||||||
|
:1002F000710083FF05C0809172008F5F8093720050
|
||||||
|
:1003000080916A0083FF05C080916B008F5F8093AE
|
||||||
|
:100310006B00E0917000F0E086B3E05AFF4F8083FD
|
||||||
|
:10032000809170008F5F8093700080E090E02FEFED
|
||||||
|
:10033000FC01E05AFF4F3081232301968A3091055A
|
||||||
|
:10034000B9F720937500809170008A3010F01092F8
|
||||||
|
:1003500070007894FF91EF919F918F913F912F9131
|
||||||
|
:100360000F900FBE0F901F901895D8DE81E790E098
|
||||||
|
:10037000B0DE8AE690E0ADDE2091750030E00090BE
|
||||||
|
:10038000730002C0359527950A94E2F780917100B9
|
||||||
|
:1003900020FF02C08E7F01C0816080937100209198
|
||||||
|
:1003A000750030E000906C0002C0359527950A94E6
|
||||||
|
:1003B000E2F780916A0020FF02C08E7F01C0816059
|
||||||
|
:1003C00080936A00D3CFE199FECF8EBBE09A992744
|
||||||
|
:1003D0008DB30895262FE199FECF1CBA8EBB2DBB9D
|
||||||
|
:1003E0000FB6F894E29AE19A0FBE01960895F89438
|
||||||
|
:0203F000FFCF3D
|
||||||
|
:00000001FF
|
|
@ -0,0 +1,65 @@
|
||||||
|
:1000000009C016C015C067C113C012C011C010C00E
|
||||||
|
:100010000FC00EC011241FBECFE9CDBF20E0A0E667
|
||||||
|
:10002000B0E001C01D92A637B207E1F79ED1DFC153
|
||||||
|
:10003000E7CFFC0180811182887F877F8083628384
|
||||||
|
:10004000438397B321E030E0A90101C0440F6A95D2
|
||||||
|
:10005000EAF7842F8095892387BB48B3C9010280C2
|
||||||
|
:1000600002C0880F991F0A94E2F7842B88BB47B31C
|
||||||
|
:10007000C901038002C0880F991F0A94E2F7842BFC
|
||||||
|
:1000800087BB88B3038002C0220F331F0A94E2F7B4
|
||||||
|
:100090002095282328BB0895FC019081338191FD90
|
||||||
|
:1000A0000BC09260908328B381E090E001C0880F7C
|
||||||
|
:1000B0003A95EAF7822B0BC09D7F908328B381E0AD
|
||||||
|
:1000C00090E001C0880F3A95EAF78095822388BBBB
|
||||||
|
:1000D0000895CF93DF93EC01888180FF13C0982FA0
|
||||||
|
:1000E0009C7039F4CE01D8DF888119828B7F8860BB
|
||||||
|
:1000F00007C083FF10C099819C3368F08460877FBC
|
||||||
|
:10010000888309C082FF02C0CE01C6DF8881877F55
|
||||||
|
:100110008B7F88831982DF91CF9108958FEF809331
|
||||||
|
:10012000750041E062E081E790E083DF44E063E056
|
||||||
|
:100130008AE690E07EDF89ED9FE20197F1F700C04B
|
||||||
|
:100140000000E199FECF80E090E03DD18A3A99F439
|
||||||
|
:1001500081E090E038D19091710080FB91F990930B
|
||||||
|
:10016000710082E090E02FD190916A0080FB91F9BC
|
||||||
|
:1001700090936A000CC06AEA80E090E02BD160E0C6
|
||||||
|
:1001800081E090E027D160E082E090E023D186B367
|
||||||
|
:1001900090E00090730002C0959587950A94E2F76D
|
||||||
|
:1001A0008170992721E082272091710080FB20F93E
|
||||||
|
:1001B0002093710086B390E000906C0002C095958A
|
||||||
|
:1001C00087950A94E2F78170992731E0832790910F
|
||||||
|
:1001D0006A0080FB90F990936A0020FD05C0809131
|
||||||
|
:1001E0006A0080FF3AC01DC021FB662760F981E0EC
|
||||||
|
:1001F000682760FB21F92093710081E090E0EAD04C
|
||||||
|
:1002000084E022E098B3922798BB4FE39BEF35E060
|
||||||
|
:10021000415090403040E1F700C00000815091F71C
|
||||||
|
:10022000DECF81FB662760F991E0692760FB81F9E9
|
||||||
|
:1002300080936A0082E090E0CDD084E020E198B322
|
||||||
|
:10024000922798BB4FE39BEF35E041509040304000
|
||||||
|
:10025000E1F700C00000815091F78091710081FFAB
|
||||||
|
:100260000CC028B381E090E00090740002C0880FB9
|
||||||
|
:10027000991F0A94E2F7822B88BB80916A0081FF64
|
||||||
|
:100280000CC028B381E090E000906D0002C0880FA0
|
||||||
|
:10029000991F0A94E2F7822B88BB10926F0010928C
|
||||||
|
:1002A0006E001FBC13BE83B7836083BF789412BEF9
|
||||||
|
:1002B00089B7826089BF0895BB9A98E088B389277F
|
||||||
|
:1002C00088BB2FE03AE787E0215030408040E1F7DB
|
||||||
|
:1002D00000C00000F3CF1F920F920FB60F921124AF
|
||||||
|
:1002E0002F933F938F939F93EF93FF93F894809175
|
||||||
|
:1002F000710083FF05C0809172008F5F8093720050
|
||||||
|
:1003000080916A0083FF05C080916B008F5F8093AE
|
||||||
|
:100310006B00E0917000F0E086B3E05AFF4F8083FD
|
||||||
|
:10032000809170008F5F8093700080E090E02FEFED
|
||||||
|
:10033000FC01E05AFF4F3081232301968A3091055A
|
||||||
|
:10034000B9F720937500809170008A3010F01092F8
|
||||||
|
:1003500070007894FF91EF919F918F913F912F9131
|
||||||
|
:100360000F900FBE0F901F901895D8DE81E790E098
|
||||||
|
:10037000B0DE8AE690E0ADDE2091750030E00090BE
|
||||||
|
:10038000730002C0359527950A94E2F780917100B9
|
||||||
|
:1003900020FF02C08E7F01C0816080937100209198
|
||||||
|
:1003A000750030E000906C0002C0359527950A94E6
|
||||||
|
:1003B000E2F780916A0020FF02C08E7F01C0816059
|
||||||
|
:1003C00080936A00D3CFE199FECF8EBBE09A992744
|
||||||
|
:1003D0008DB30895262FE199FECF1CBA8EBB2DBB9D
|
||||||
|
:1003E0000FB6F894E29AE19A0FBE01960895F89438
|
||||||
|
:0203F000FFCF3D
|
||||||
|
:00000001FF
|
Binary file not shown.
Loading…
Reference in New Issue