Merge pull request #459 from adamdunkels/push/mc1322x-stuff
MC1322x additions
This commit is contained in:
commit
5fbefbd87b
|
@ -81,26 +81,32 @@ else
|
|||
endif
|
||||
|
||||
$(OBJECTDIR)/%.lds: $(CONTIKI_CPU)/%.lds.S | $(OBJECTDIR)
|
||||
$(CPP) $(CPPFLAGS) $< > $@
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CPP) $(CPPFLAGS) $< > $@
|
||||
|
||||
$(OBJECTDIR)/isr.o: $(CONTIKI_CPU)/src/isr.c | $(OBJECTDIR)
|
||||
$(CC) $(CFLAGS) $(ARM_FLAGS) $< -c -o $@
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(CFLAGS) $(ARM_FLAGS) $< -c -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(THUMB_FLAGS) $< -c
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(CFLAGS) $(THUMB_FLAGS) $< -c
|
||||
|
||||
$(OBJECTDIR)/%.o: %.c | $(OBJECTDIR)
|
||||
$(CC) $(CFLAGS) $(THUMB_FLAGS) -c $< -o $@
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(CFLAGS) $(THUMB_FLAGS) -c $< -o $@
|
||||
|
||||
CUSTOM_RULE_S_TO_OBJECTDIR_O = yes
|
||||
|
||||
$(OBJECTDIR)/%.o: %.S | $(OBJECTDIR)
|
||||
$(CC) $(CFLAGS) $(AFLAGS) $(ARM_FLAGS) $< -c -o $@
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(CFLAGS) $(AFLAGS) $(ARM_FLAGS) $< -c -o $@
|
||||
|
||||
CUSTOM_RULE_C_TO_CO=yes
|
||||
|
||||
%.co: %.c
|
||||
$(CC) $(CFLAGS) -DAUTOSTART_ENABLE $(THUMB_FLAGS) $< -c -o $@
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(CFLAGS) -DAUTOSTART_ENABLE $(THUMB_FLAGS) $< -c -o $@
|
||||
|
||||
.PRECIOUS: %.bin %_$(TARGET).bin
|
||||
|
||||
|
@ -114,6 +120,7 @@ CUSTOM_RULE_C_TO_CO=yes
|
|||
@
|
||||
|
||||
%.elf: $(OBJECTDIR)/board.h %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a $(STARTUP) $(OBJECTDIR)/mc1322x.lds
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -nostartfiles -o $@ $(filter-out %.a %.lds,$^) $(filter %.a,$^) $(filter %.a,$^)
|
||||
$(TRACE_CC)
|
||||
$(Q)$(CC) $(LDFLAGS) $(CFLAGS) -nostartfiles -o $@ $(filter-out %.a %.lds,$^) $(filter %.a,$^) $(filter %.a,$^)
|
||||
|
||||
|
||||
|
|
|
@ -34,30 +34,38 @@
|
|||
*/
|
||||
|
||||
#include "dev/watchdog.h"
|
||||
#include <mc1322x.h>
|
||||
#include <board.h>
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
watchdog_init(void)
|
||||
{
|
||||
cop_timeout_ms(1000);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
watchdog_start(void)
|
||||
{
|
||||
CRM->COP_CNTLbits.COP_EN = 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
watchdog_periodic(void)
|
||||
{
|
||||
cop_service();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
watchdog_stop(void)
|
||||
{
|
||||
CRM->COP_CNTLbits.COP_EN = 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
watchdog_reboot(void)
|
||||
{
|
||||
watchdog_start();
|
||||
while(1);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in a new issue