Browse Source

Enable higher baudrate with mbed

Thomas Buck 8 years ago
parent
commit
b809169f28
3 changed files with 9 additions and 1 deletions
  1. 4
    0
      include/serial.h
  2. 1
    1
      src/arm/serial.cpp
  3. 4
    0
      src/main.c

+ 4
- 0
include/serial.h View File

63
  *  \param uart UART Module to initialize
63
  *  \param uart UART Module to initialize
64
  *  \param baud Baudrate. Use the BAUD() macro!
64
  *  \param baud Baudrate. Use the BAUD() macro!
65
  */
65
  */
66
+#if defined(__AVR__)
66
 void serialInit(uint8_t uart, uint16_t baud);
67
 void serialInit(uint8_t uart, uint16_t baud);
68
+#else
69
+void serialInit(uint8_t uart, uint32_t baud);
70
+#endif
67
 
71
 
68
 /** Stop the UART Hardware.
72
 /** Stop the UART Hardware.
69
  *  \param uart UART Module to stop
73
  *  \param uart UART Module to stop

+ 1
- 1
src/arm/serial.cpp View File

20
     return UART_COUNT;
20
     return UART_COUNT;
21
 }
21
 }
22
 
22
 
23
-void serialInit(uint8_t uart, uint16_t baud) {
23
+void serialInit(uint8_t uart, uint32_t baud) {
24
     if (uart >= UART_COUNT)
24
     if (uart >= UART_COUNT)
25
         return;
25
         return;
26
 
26
 

+ 4
- 0
src/main.c View File

75
     timerInit();
75
     timerInit();
76
 
76
 
77
 #ifdef DEBUG
77
 #ifdef DEBUG
78
+#if defined(__AVR__)
78
     serialInit(0, BAUD(38400, F_CPU));
79
     serialInit(0, BAUD(38400, F_CPU));
80
+#else
81
+    serialInit(0, BAUD(115200, F_CPU));
82
+#endif
79
 #endif
83
 #endif
80
 
84
 
81
 #ifdef __AVR__
85
 #ifdef __AVR__

Loading…
Cancel
Save