diff --git a/02_m1284p_FATFS_Chang_tst/main.c b/02_m1284p_FATFS_Chang_tst/main.c index 9c670bd..5054dc3 100644 --- a/02_m1284p_FATFS_Chang_tst/main.c +++ b/02_m1284p_FATFS_Chang_tst/main.c @@ -150,7 +150,7 @@ int xatoi ( /* 0:Failed, 1:Successful */ //************************* Fat FS declare related: END -//***********Prologue for fast WDT disable & and save reason of reset/power-up: END +//***********Prologue for fast WDT disable & and save reason of reset/power-up: BEGIN uint8_t mcucsr_mirror __attribute__ ((section (".noinit"))); // This is for fast WDT disable & and save reason of reset/power-up diff --git a/02_m1284p_FATFS_LFN_Chang_tst/main.c b/02_m1284p_FATFS_LFN_Chang_tst/main.c index 38dfcfe..96d7d0d 100644 --- a/02_m1284p_FATFS_LFN_Chang_tst/main.c +++ b/02_m1284p_FATFS_LFN_Chang_tst/main.c @@ -149,6 +149,7 @@ int xatoi ( /* 0:Failed, 1:Successful */ //************************* Fat FS declare related: END +//***********Prologue for fast WDT disable & and save reason of reset/power-up: BEGIN uint8_t mcucsr_mirror __attribute__ ((section (".noinit"))); // This is for fast WDT disable & and save reason of reset/power-up diff --git a/03_m1284p_WIZNET_loopback_FATFS_template/main.c b/03_m1284p_WIZNET_loopback_FATFS_template/main.c index 27e6564..f9a408f 100644 --- a/03_m1284p_WIZNET_loopback_FATFS_template/main.c +++ b/03_m1284p_WIZNET_loopback_FATFS_template/main.c @@ -57,7 +57,7 @@ wiz_NetInfo netInfo = { .mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef}, // Mac add * */ -//***********Prologue for fast WDT disable & and save reason of reset/power-up: END +//***********Prologue for fast WDT disable & and save reason of reset/power-up: BEGIN uint8_t mcucsr_mirror __attribute__ ((section (".noinit"))); // This is for fast WDT disable & and save reason of reset/power-up diff --git a/03_m1284p_WIZNET_loopback_STATIC_IP/main.c b/03_m1284p_WIZNET_loopback_STATIC_IP/main.c index b2bb728..690a7b0 100644 --- a/03_m1284p_WIZNET_loopback_STATIC_IP/main.c +++ b/03_m1284p_WIZNET_loopback_STATIC_IP/main.c @@ -35,7 +35,7 @@ * */ -//***********Prologue for fast WDT disable & and save reason of reset/power-up: END +//***********Prologue for fast WDT disable & and save reason of reset/power-up: BEGIN uint8_t mcucsr_mirror __attribute__ ((section (".noinit"))); // This is for fast WDT disable & and save reason of reset/power-up diff --git a/04_m1284p_WIZNET_loopback_DHCP/main.c b/04_m1284p_WIZNET_loopback_DHCP/main.c index 96da67f..ce322c8 100644 --- a/04_m1284p_WIZNET_loopback_DHCP/main.c +++ b/04_m1284p_WIZNET_loopback_DHCP/main.c @@ -19,6 +19,20 @@ #include "Internet/DHCP/dhcp.h" #include "Application/loopback/loopback.h" +//***********Prologue for fast WDT disable & and save reason of reset/power-up: BEGIN +uint8_t mcucsr_mirror __attribute__ ((section (".noinit"))); + +// This is for fast WDT disable & and save reason of reset/power-up +void get_mcusr(void) \ + __attribute__((naked)) \ + __attribute__((section(".init3"))); +void get_mcusr(void) +{ + mcucsr_mirror = MCUSR; + MCUSR = 0; + wdt_disable(); +} +//***********Prologue for fast WDT disable & and save reason of reset/power-up: END //#include // itoa etc.. /* diff --git a/05_m1284p_WIZNET_DNS_client/main.c b/05_m1284p_WIZNET_DNS_client/main.c index f779fa9..487b679 100644 --- a/05_m1284p_WIZNET_DNS_client/main.c +++ b/05_m1284p_WIZNET_DNS_client/main.c @@ -56,6 +56,21 @@ #define sw1_conf() {DDRC &= ~(1<