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
reset/rsid.c@49:d056e2c5c4ee, 2019-05-08 (annotated)
- Committer:
- andrewboyson
- Date:
- Wed May 08 12:13:37 2019 +0000
- Revision:
- 49:d056e2c5c4ee
Sorted out reset module to properly read the RSID register
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andrewboyson | 49:d056e2c5c4ee | 1 | #include <stdbool.h> |
| andrewboyson | 49:d056e2c5c4ee | 2 | |
| andrewboyson | 49:d056e2c5c4ee | 3 | #define RSID (*((volatile unsigned *) 0x400FC180)) |
| andrewboyson | 49:d056e2c5c4ee | 4 | |
| andrewboyson | 49:d056e2c5c4ee | 5 | bool RsidPor = false; |
| andrewboyson | 49:d056e2c5c4ee | 6 | bool RsidExtr = false; |
| andrewboyson | 49:d056e2c5c4ee | 7 | bool RsidWdtr = false; |
| andrewboyson | 49:d056e2c5c4ee | 8 | bool RsidBodr = false; |
| andrewboyson | 49:d056e2c5c4ee | 9 | |
| andrewboyson | 49:d056e2c5c4ee | 10 | void RsidInit() |
| andrewboyson | 49:d056e2c5c4ee | 11 | { |
| andrewboyson | 49:d056e2c5c4ee | 12 | RsidPor = RSID & 1; //RSID is defined in 3.4.1 Reset Source Identification Register |
| andrewboyson | 49:d056e2c5c4ee | 13 | RsidExtr = RSID & 2; |
| andrewboyson | 49:d056e2c5c4ee | 14 | RsidWdtr = RSID & 4; |
| andrewboyson | 49:d056e2c5c4ee | 15 | RsidBodr = RSID & 8; |
| andrewboyson | 49:d056e2c5c4ee | 16 | RSID = 0xF; //Clear any values |
| andrewboyson | 49:d056e2c5c4ee | 17 | } |