Wim Huiskamp
/
mbed_nucleo_swo
Test for SWO viewer library.
See here for more information.
Diff: main.cpp
- Revision:
- 2:9c50385f83c5
- Parent:
- 1:3308ab077592
- Child:
- 3:3d2422feccb5
--- a/main.cpp Tue Dec 23 21:06:11 2014 +0000 +++ b/main.cpp Sun Apr 03 12:39:24 2016 +0000 @@ -1,4 +1,25 @@ - +/* mbed Test program for debug and monitoring of ST nucleo boards with SWO. + * Copyright (c) 2015, v01: WH, Initial version + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + #include "mbed.h" #include "SWO.h" @@ -19,7 +40,12 @@ SWO_Channel SWO; int main() { - pc.printf("Hello World\n\r"); +#if defined(TARGET_NUCLEO_F103RB) + pc.printf("Hello World from ST32F103RB\n\r"); +#endif +#if defined(TARGET_NUCLEO_F446RE) + pc.printf("Hello World from ST32F446RE\n\r"); +#endif // pc.printf("\r\nMy Program - build " MBED_BUILD_TIMESTAMP "\r\n"); pc.printf("\r\nMy Program - (partial) build " __DATE__ " " __TIME__ "\r\n"); pc.printf("CPU SystemCoreClock is %d Hz\r\n", SystemCoreClock); @@ -35,12 +61,13 @@ wait(0.2); // 200 ms myled = 0; // LED is OFF wait(1.0); // 1 sec - + + pc.putc('*'); + #if (D_SWO == 1) //Stream SWO.putc('#'); -#endif - +#endif } }