coursework
Dependencies: USBDevice mbed-rtos mbed
Diff: function_generator/serial.h
- Revision:
- 0:c059d38d6074
diff -r 000000000000 -r c059d38d6074 function_generator/serial.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/function_generator/serial.h Mon Nov 28 10:32:43 2016 +0000 @@ -0,0 +1,22 @@ +#ifndef _SERIAL_H +#define _SERIAL_H + +#include "mbed.h" +#include "USBSerial.h" + +// Virtual serial port over USB +class USB_Serial : public USBSerial { +public: + void flush(); + + /* It seems original gets() does not work, + probably due to the newline character. */ + int gets (char* str, int size); +}; + +extern USB_Serial serial; + +#define BUFFER_SIZE 1000 +extern char* buffer; + +#endif