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,7 +63,11 @@ uint8_t serialAvailable(void);
63 63
  *  \param uart UART Module to initialize
64 64
  *  \param baud Baudrate. Use the BAUD() macro!
65 65
  */
66
+#if defined(__AVR__)
66 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 72
 /** Stop the UART Hardware.
69 73
  *  \param uart UART Module to stop

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

@@ -20,7 +20,7 @@ uint8_t serialAvailable(void) {
20 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 24
     if (uart >= UART_COUNT)
25 25
         return;
26 26
 

+ 4
- 0
src/main.c View File

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

Loading…
Cancel
Save