mbed-os
Fork of mbed-os by
features/unsupported/tests/mbed/reset/main.cpp@1:3deb71413561, 2017-07-20 (annotated)
- Committer:
- xuaner
- Date:
- Thu Jul 20 14:26:57 2017 +0000
- Revision:
- 1:3deb71413561
- Parent:
- 0:f269e3021894
mbed_os
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 | } |