From 80eba95457130e93f99631ae7ea719493d472bf8 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 20 Nov 2017 11:55:18 +0000 Subject: [PATCH] Option for bootloader entry on soft reset --- xboot.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xboot.c b/xboot.c index ebedb66..9a86dfc 100644 --- a/xboot.c +++ b/xboot.c @@ -321,7 +321,15 @@ int main(void) // whether or not USE_ENTER_DELAY is selected // -------------------------------------------------- - + #ifdef USE_ENTER_SWRST + // Check for soft reset +#ifdef __AVR_XMEGA__ + if (RST.STATUS == RST_SRF_bm) + in_bootloader = 1; +#else // __AVR_XMEGA__ +#error USE_ENTER_SWRST supported on XMEGA only! +#endif // __AVR_XMEGA__ + #endif // USE_ENTER_SWRST // -------------------------------------------------- // End one time trigger section