Add makefile target for running in simulated environment
This commit is contained in:
12
Makefile
12
Makefile
@@ -12,12 +12,13 @@ VERBOSE := false
|
|||||||
ARCH := m1284
|
ARCH := m1284
|
||||||
#FREQ := 18432000UL
|
#FREQ := 18432000UL
|
||||||
FREQ := 8000000UL
|
FREQ := 8000000UL
|
||||||
MCU := atmega1284
|
MCU := atmega1284p
|
||||||
ASP := usbasp
|
ASP := usbasp
|
||||||
CC := avr-gcc
|
CC := avr-gcc
|
||||||
LD := $(CC)
|
LD := $(CC)
|
||||||
OBJCOPY := avr-objcopy
|
OBJCOPY := avr-objcopy
|
||||||
AVD := avrdude
|
AVD := avrdude
|
||||||
|
SIM := simavr
|
||||||
MKDIR := mkdir -p
|
MKDIR := mkdir -p
|
||||||
RMR := rm -rf
|
RMR := rm -rf
|
||||||
GIT := git
|
GIT := git
|
||||||
@@ -49,8 +50,13 @@ DEPENDS := $(FILES:%.c=$(TMPDIR)/%.d)
|
|||||||
# AUXILIARY TARGETS (AND FUSE SETTINGS)
|
# AUXILIARY TARGETS (AND FUSE SETTINGS)
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
.PHONY: all
|
# .PHONY: all
|
||||||
all: flash
|
# all: flash
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
run: $(TARGET)
|
||||||
|
$(E) "[SIM] $<"
|
||||||
|
$(Q) $(SIM) -m $(MCU) -f $(FREQ) $<
|
||||||
|
|
||||||
.PHONY: flash
|
.PHONY: flash
|
||||||
flash: $(TARGET)
|
flash: $(TARGET)
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ static int Init(void)
|
|||||||
// - Wrong fuses? Unlikely.
|
// - Wrong fuses? Unlikely.
|
||||||
// - Bootloader problems?
|
// - Bootloader problems?
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// The watchdog timer is clocked from a separate
|
// The watchdog timer is clocked from a separate
|
||||||
// on-chip oscillator which runs at 1 MHz. Eight
|
// on-chip oscillator which runs at 1 MHz. Eight
|
||||||
// different clock cycle periods can be selected
|
// different clock cycle periods can be selected
|
||||||
@@ -242,13 +240,10 @@ int main(void)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
WDT_Reset();
|
WDT_Reset();
|
||||||
Info("UPDATE");
|
Update();
|
||||||
continue;
|
|
||||||
// Update();
|
|
||||||
WDT_Reset();
|
WDT_Reset();
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
UNUSED(Update);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user