mbed-os
Fork of mbed-os by
features/unsupported/tests/mbed/reset/main.cpp@0:f269e3021894, 2016-10-23 (annotated)
- Committer:
- elessair
- Date:
- Sun Oct 23 15:10:02 2016 +0000
- Revision:
- 0:f269e3021894
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | #include "mbed.h" |
elessair | 0:f269e3021894 | 2 | |
elessair | 0:f269e3021894 | 3 | #if !DEVICE_SEMIHOST |
elessair | 0:f269e3021894 | 4 | #error [NOT_SUPPORTED] Semihost not supported |
elessair | 0:f269e3021894 | 5 | #endif |
elessair | 0:f269e3021894 | 6 | |
elessair | 0:f269e3021894 | 7 | Serial pc(USBTX, USBRX); |
elessair | 0:f269e3021894 | 8 | |
elessair | 0:f269e3021894 | 9 | extern "C" void mbed_reset(); |
elessair | 0:f269e3021894 | 10 | |
elessair | 0:f269e3021894 | 11 | int main() { |
elessair | 0:f269e3021894 | 12 | pc.printf("start\n"); |
elessair | 0:f269e3021894 | 13 | wait(1); |
elessair | 0:f269e3021894 | 14 | |
elessair | 0:f269e3021894 | 15 | unsigned int counter = 0; |
elessair | 0:f269e3021894 | 16 | while(1) { |
elessair | 0:f269e3021894 | 17 | pc.printf("%u\n",counter++); |
elessair | 0:f269e3021894 | 18 | wait(1); |
elessair | 0:f269e3021894 | 19 | mbed_reset(); |
elessair | 0:f269e3021894 | 20 | } |
elessair | 0:f269e3021894 | 21 | } |