diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-07-03 15:34:29 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-07-03 15:35:28 +0200 |
commit | 0f390b743634ef4cdda03da8cb3f175524d59bd0 (patch) | |
tree | 829dd7907fdf11190cb8b153d76bab0a3e8d1c1a /usbserial.h | |
parent | 1a8771c5d0e23fb91cb926614933405f39049d63 (diff) |
Removed old stuff.
Diffstat (limited to 'usbserial.h')
-rw-r--r-- | usbserial.h | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/usbserial.h b/usbserial.h deleted file mode 100644 index c312821..0000000 --- a/usbserial.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef USBSERIAL_H -#define USBSERIAL_H - -#include <ch.h> -#include <hal.h> -#include <usb_cdc.h> - -class USBSerial { - public: - SerialUSBDriver susbdriver; - - public: - void init(); - - inline msg_t getc(systime_t timeout = TIME_INFINITE) { - return chIQGetTimeout(&susbdriver.iqueue, timeout); - } - - inline size_t read(uint8_t* buf, size_t len, systime_t timeout = TIME_INFINITE) { - return chIQReadTimeout(&susbdriver.iqueue, buf, len, timeout); - } - - inline msg_t putc(uint8_t data, systime_t timeout = TIME_INFINITE) { - if(USBD1.state != USB_ACTIVE) { - return 0; - } - return chOQPutTimeout(&susbdriver.oqueue, data, timeout); - } - - inline size_t write(uint8_t* buf, size_t len, systime_t timeout = TIME_INFINITE) { - if(USBD1.state != USB_ACTIVE) { - return 0; - } - return chOQWriteTimeout(&susbdriver.oqueue, buf, len, timeout); - } -}; - -#endif |