Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: test-lpc1768 oldheating gps motorhome ... more
Diff: reset/rsid.c
- Revision:
- 49:d056e2c5c4ee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/reset/rsid.c Wed May 08 12:13:37 2019 +0000
@@ -0,0 +1,17 @@
+#include <stdbool.h>
+
+#define RSID (*((volatile unsigned *) 0x400FC180))
+
+bool RsidPor = false;
+bool RsidExtr = false;
+bool RsidWdtr = false;
+bool RsidBodr = false;
+
+void RsidInit()
+{
+ RsidPor = RSID & 1; //RSID is defined in 3.4.1 Reset Source Identification Register
+ RsidExtr = RSID & 2;
+ RsidWdtr = RSID & 4;
+ RsidBodr = RSID & 8;
+ RSID = 0xF; //Clear any values
+}
\ No newline at end of file