Do reset on pin 31 only on xplain.

This commit is contained in:
flabbergast 2015-03-30 19:00:40 +01:00
parent 7d86bd9aa2
commit bc4570f561
2 changed files with 7 additions and 1 deletions

View file

@ -369,11 +369,14 @@ void init()
RTC_COMPINTLVL_OFF_gc;
#endif
#if defined(XMEGA_XPLAIN)
/*************************************/
/* Enable reset button */
initResetButton();
/*************************************/
#endif
/* Enable interrupts. */
PMIC.CTRL |= PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
sei();
@ -447,6 +450,7 @@ static uint8_t ReadCalibrationByte(uint8_t index)
// TODO: Do this only for xplain board.
#if defined(XMEGA_XPLAIN)
static const byte resetPin = 31;
static void resetRupt() {
@ -461,3 +465,5 @@ static void resetRupt() {
static void initResetButton() {
attachInterrupt( resetPin, resetRupt, FALLING );
}
#endif

View file

@ -29,7 +29,7 @@ compiler.elf2hex.cmd=avr-objcopy
compiler.ldflags=
compiler.size.cmd=avr-size
# this can be overriden in boards.txt
build.extra_flags=-D{build.usbtype}
build.extra_flags=-D{build.usbtype} -D{build.board}
# AVR compile patterns
# --------------------