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.
libraries/tests/mbed/reset/main.cpp@0:6c56fb4bc5f0, 2016-11-04 (annotated)
- Committer:
- nexpaq
- Date:
- Fri Nov 04 20:27:58 2016 +0000
- Revision:
- 0:6c56fb4bc5f0
Moving to library for sharing updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nexpaq | 0:6c56fb4bc5f0 | 1 | #include "mbed.h" |
nexpaq | 0:6c56fb4bc5f0 | 2 | |
nexpaq | 0:6c56fb4bc5f0 | 3 | #if !DEVICE_SEMIHOST |
nexpaq | 0:6c56fb4bc5f0 | 4 | #error [NOT_SUPPORTED] Semihost not supported |
nexpaq | 0:6c56fb4bc5f0 | 5 | #endif |
nexpaq | 0:6c56fb4bc5f0 | 6 | |
nexpaq | 0:6c56fb4bc5f0 | 7 | Serial pc(USBTX, USBRX); |
nexpaq | 0:6c56fb4bc5f0 | 8 | |
nexpaq | 0:6c56fb4bc5f0 | 9 | extern "C" void mbed_reset(); |
nexpaq | 0:6c56fb4bc5f0 | 10 | |
nexpaq | 0:6c56fb4bc5f0 | 11 | int main() { |
nexpaq | 0:6c56fb4bc5f0 | 12 | pc.printf("start\n"); |
nexpaq | 0:6c56fb4bc5f0 | 13 | wait(1); |
nexpaq | 0:6c56fb4bc5f0 | 14 | |
nexpaq | 0:6c56fb4bc5f0 | 15 | unsigned int counter = 0; |
nexpaq | 0:6c56fb4bc5f0 | 16 | while(1) { |
nexpaq | 0:6c56fb4bc5f0 | 17 | pc.printf("%u\n",counter++); |
nexpaq | 0:6c56fb4bc5f0 | 18 | wait(1); |
nexpaq | 0:6c56fb4bc5f0 | 19 | mbed_reset(); |
nexpaq | 0:6c56fb4bc5f0 | 20 | } |
nexpaq | 0:6c56fb4bc5f0 | 21 | } |