diff --git a/src/config/conf_usb.h b/src/config/conf_usb.h index 1d927a071b56cd5c589bc18180abd5d70bdf9f81..89a3885feb10f55010a5f227361aac48ff7aab2a 100644 --- a/src/config/conf_usb.h +++ b/src/config/conf_usb.h @@ -125,7 +125,7 @@ #define UDI_CDC_RX_NOTIFY(port) #define UDI_CDC_SET_CODING_EXT(port,cfg) #define UDI_CDC_SET_DTR_EXT(port,set) -#define UDI_CDC_SET_RTS_EXT(port,set) +//#define UDI_CDC_SET_RTS_EXT(port,set) /* * #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable() * extern bool my_callback_cdc_enable(void); @@ -140,6 +140,8 @@ * #define UDI_CDC_SET_RTS_EXT(port,set) my_callback_cdc_set_rts(port,set) * extern void my_callback_cdc_set_rts(uint8_t port, bool b_enable); */ +#define UDI_CDC_SET_RTS_EXT(port,set) my_callback_cdc_set_rts(port,set) +extern void my_callback_cdc_set_rts(uint8_t port, uint8_t b_enable); //! Define it when the transfer CDC Device to Host is a low rate (<512000 bauds) //! to reduce CDC buffers size @@ -162,5 +164,6 @@ //! The includes of classes and other headers must be done at the end of this file to avoid compile error #include "udi_cdc_conf.h" +#include "leds.h" #endif // _CONF_USB_H_ diff --git a/src/leds.c b/src/leds.c new file mode 100644 index 0000000000000000000000000000000000000000..163ad70202eba3212a4185f4a2d896f25ce84b4b --- /dev/null +++ b/src/leds.c @@ -0,0 +1,19 @@ +// +// leds.c +// dstat-firmware +// +// Created by Michael Dryden on 2017-05-04. +// Copyright © 2017 Michael Dryden. All rights reserved. +// + +#include "leds.h" +#include "config/conf_board.h" +#include <ioport.h> + +void my_callback_cdc_set_rts(uint8_t port, uint8_t b_enable){ + #if BOARD_VER_MAJOR >= 1 && BOARD_VER_MINOR >= 2 && BOARD_VER_MICRO >=3 + ioport_set_pin_level(LED2, b_enable); + #endif +} + + diff --git a/src/leds.h b/src/leds.h new file mode 100644 index 0000000000000000000000000000000000000000..7eae01223432699420e1be3a79cc27ef27e8fa42 --- /dev/null +++ b/src/leds.h @@ -0,0 +1,17 @@ +// +// leds.h +// dstat-firmware +// +// Created by Michael Dryden on 2017-05-04. +// Copyright © 2017 Michael Dryden. All rights reserved. +// + +#ifndef leds_h +#define leds_h + +#include <stdio.h> + +void my_callback_cdc_set_rts(uint8_t port, uint8_t b_enable); + + +#endif /* leds_h */