![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
coursework
Dependencies: USBDevice mbed-rtos mbed
function_generator/serial.h@0:c059d38d6074, 2016-11-28 (annotated)
- Committer:
- riyood
- Date:
- Mon Nov 28 10:32:43 2016 +0000
- Revision:
- 0:c059d38d6074
the coursework;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
riyood | 0:c059d38d6074 | 1 | #ifndef _SERIAL_H |
riyood | 0:c059d38d6074 | 2 | #define _SERIAL_H |
riyood | 0:c059d38d6074 | 3 | |
riyood | 0:c059d38d6074 | 4 | #include "mbed.h" |
riyood | 0:c059d38d6074 | 5 | #include "USBSerial.h" |
riyood | 0:c059d38d6074 | 6 | |
riyood | 0:c059d38d6074 | 7 | // Virtual serial port over USB |
riyood | 0:c059d38d6074 | 8 | class USB_Serial : public USBSerial { |
riyood | 0:c059d38d6074 | 9 | public: |
riyood | 0:c059d38d6074 | 10 | void flush(); |
riyood | 0:c059d38d6074 | 11 | |
riyood | 0:c059d38d6074 | 12 | /* It seems original gets() does not work, |
riyood | 0:c059d38d6074 | 13 | probably due to the newline character. */ |
riyood | 0:c059d38d6074 | 14 | int gets (char* str, int size); |
riyood | 0:c059d38d6074 | 15 | }; |
riyood | 0:c059d38d6074 | 16 | |
riyood | 0:c059d38d6074 | 17 | extern USB_Serial serial; |
riyood | 0:c059d38d6074 | 18 | |
riyood | 0:c059d38d6074 | 19 | #define BUFFER_SIZE 1000 |
riyood | 0:c059d38d6074 | 20 | extern char* buffer; |
riyood | 0:c059d38d6074 | 21 | |
riyood | 0:c059d38d6074 | 22 | #endif |