![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
aaa
Dependencies: mbed-STM32F103C8T6 mbed
Fork of STM32F103C8T6_USBSerial by
main.cpp@1:0e1269402efd, 2016-07-08 (annotated)
- Committer:
- hudakz
- Date:
- Fri Jul 08 21:29:34 2016 +0000
- Revision:
- 1:0e1269402efd
- Parent:
- 0:0279e8c1f111
- Child:
- 2:2c819b99d216
Updated
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hudakz | 0:0279e8c1f111 | 1 | #include "stm32f103c8t6.h" |
hudakz | 0:0279e8c1f111 | 2 | #include "mbed.h" |
hudakz | 0:0279e8c1f111 | 3 | #include "USBSerial.h" |
hudakz | 0:0279e8c1f111 | 4 | |
hudakz | 0:0279e8c1f111 | 5 | Serial pc(PA_2, PA_3); |
hudakz | 0:0279e8c1f111 | 6 | DigitalOut myled(LED1); |
hudakz | 0:0279e8c1f111 | 7 | |
hudakz | 0:0279e8c1f111 | 8 | int main() { |
hudakz | 1:0e1269402efd | 9 | confSysClock(48); //Configure system clock (72MHz HSE clock, 48MHz APB1 peripheral clock) |
hudakz | 0:0279e8c1f111 | 10 | USBSerial usbSerial; |
hudakz | 0:0279e8c1f111 | 11 | |
hudakz | 0:0279e8c1f111 | 12 | pc.baud(9600); |
hudakz | 0:0279e8c1f111 | 13 | |
hudakz | 0:0279e8c1f111 | 14 | while(1) { |
hudakz | 0:0279e8c1f111 | 15 | myled = !myled; |
hudakz | 0:0279e8c1f111 | 16 | pc.printf("I am a serial port\r\n"); |
hudakz | 1:0e1269402efd | 17 | usbSerial.printf("I am a USB serial port\r\n"); |
hudakz | 0:0279e8c1f111 | 18 | wait_ms(1000); |
hudakz | 0:0279e8c1f111 | 19 | } |
hudakz | 0:0279e8c1f111 | 20 | } |
hudakz | 0:0279e8c1f111 | 21 |