Skip to content
Snippets Groups Projects
Commit c4111419 authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Set LED2 to follow RTS signal on USB.

parent 455ec5ac
Branches
Tags v1.3
Pipeline #95 passed with stage
in 35 seconds
......@@ -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_
//
// 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
}
//
// 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 */
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment