+\r
+ // If the app is the reset byte (0x80) increment and loop\r
+ if (app == 0x80) {\r
+ reset_count++;\r
+\r
+ if (reset_count > 4) {\r
+ // We could trigger the WDT with either:\r
+ // WDTCTL = 0;\r
+ // or\r
+ // WDTCTL = WDTPW + WDTCNTCL + WDTSSEL + 0x00;\r
+ // but instead we'll jump to our reboot function pointer\r
+ (*reboot_function)();\r
+ }\r
+\r
+ continue;\r
+ } else {\r
+ reset_count = 0;\r
+ }\r
+\r