serial debug Monitor
debugMonitor.cpp@0:de1f07a7cd82, 2018-08-23 (annotated)
- Committer:
- duchonic
- Date:
- Thu Aug 23 10:32:26 2018 +0000
- Revision:
- 0:de1f07a7cd82
- Child:
- 1:a2fab59c3b98
first
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
duchonic | 0:de1f07a7cd82 | 1 | #include "debugMonitor.h" |
duchonic | 0:de1f07a7cd82 | 2 | #include "main.h" |
duchonic | 0:de1f07a7cd82 | 3 | |
duchonic | 0:de1f07a7cd82 | 4 | debugMonitor::debugMonitor(PinName tx, PinName rx) : serial(tx, rx) {} |
duchonic | 0:de1f07a7cd82 | 5 | |
duchonic | 0:de1f07a7cd82 | 6 | uint8_t debugMonitor::debugMonitor_Init(void) |
duchonic | 0:de1f07a7cd82 | 7 | { |
duchonic | 0:de1f07a7cd82 | 8 | serial.baud(115200); |
duchonic | 0:de1f07a7cd82 | 9 | serial.printf("debugMonitor_Init\n"); |
duchonic | 0:de1f07a7cd82 | 10 | return(0); |
duchonic | 0:de1f07a7cd82 | 11 | } |
duchonic | 0:de1f07a7cd82 | 12 | |
duchonic | 0:de1f07a7cd82 | 13 | debugMonitor::~debugMonitor(void) { |
duchonic | 0:de1f07a7cd82 | 14 | }; |
duchonic | 0:de1f07a7cd82 | 15 | |
duchonic | 0:de1f07a7cd82 | 16 | void debugMonitor::debugMonitor_Job(void) |
duchonic | 0:de1f07a7cd82 | 17 | { |
duchonic | 0:de1f07a7cd82 | 18 | if(serial.readable()) |
duchonic | 0:de1f07a7cd82 | 19 | { |
duchonic | 0:de1f07a7cd82 | 20 | serial.putc(serial.getc()); |
duchonic | 0:de1f07a7cd82 | 21 | } |
duchonic | 0:de1f07a7cd82 | 22 | } |