remove led from cdc
This commit is contained in:
parent
a5bfd0e961
commit
6601c91af5
5 changed files with 8 additions and 21 deletions
|
@ -24,7 +24,7 @@ class GpioClass {
|
||||||
GPIOA_Type & port;
|
GPIOA_Type & port;
|
||||||
const uint32_t pin;
|
const uint32_t pin;
|
||||||
public:
|
public:
|
||||||
explicit constexpr GpioClass (GPIOA_Type & _port, const uint32_t _pin, const uint32_t _mode = GPIO_AI_PPO | GPIO_Speed_10MHz) noexcept
|
explicit GpioClass (GPIOA_Type & _port, const uint32_t _pin, const uint32_t _mode = GPIO_AI_PPO | GPIO_Speed_10MHz) noexcept
|
||||||
: port(_port), pin(_pin) {
|
: port(_port), pin(_pin) {
|
||||||
/* Zapneme vše, ono je to dost jedno. */
|
/* Zapneme vše, ono je to dost jedno. */
|
||||||
RCC.APB2PCENR.modify([](RCC_Type::APB2PCENR_DEF & r)->auto {
|
RCC.APB2PCENR.modify([](RCC_Type::APB2PCENR_DEF & r)->auto {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "cdc_class.h"
|
#include "cdc_class.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "project_config.h"
|
// #include "project_config.h"
|
||||||
typedef __SIZE_TYPE__ size_t;
|
typedef __SIZE_TYPE__ size_t;
|
||||||
/* Only one instance of this class ! */
|
/* Only one instance of this class ! */
|
||||||
static cdc_class * pInstance = nullptr;
|
static cdc_class * pInstance = nullptr;
|
||||||
|
@ -98,11 +98,11 @@ void cdc_class::USBFS_Device_Init( bool sta ) {
|
||||||
USBFSD->BASE_CTRL = 0x00;
|
USBFSD->BASE_CTRL = 0x00;
|
||||||
NVIC.DisableIRQ( USBFS_IRQn );
|
NVIC.DisableIRQ( USBFS_IRQn );
|
||||||
}
|
}
|
||||||
dtr << LED_OFF;
|
// dtr << LED_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
cdc_class::cdc_class() noexcept : BaseLayer(),
|
cdc_class::cdc_class() noexcept : BaseLayer(),
|
||||||
CtrlIface(nullptr), dtr (DTR_LED), TxRing(), Ready(false), LineCoding() {
|
CtrlIface(nullptr), /*dtr (DTR_LED),*/ TxRing(), Ready(false), LineCoding() {
|
||||||
pInstance = this;
|
pInstance = this;
|
||||||
USBFS_DevConfig = 0;
|
USBFS_DevConfig = 0;
|
||||||
USBFS_DevAddr = 0;
|
USBFS_DevAddr = 0;
|
||||||
|
@ -247,8 +247,10 @@ union DtrRts {
|
||||||
if (CtrlIface) CtrlIface->IOCtrl(USB_USART_SET_DTR_RTS, tmp.bytes, 2);
|
if (CtrlIface) CtrlIface->IOCtrl(USB_USART_SET_DTR_RTS, tmp.bytes, 2);
|
||||||
const bool b = USBFS_SetupReqValue & 1;
|
const bool b = USBFS_SetupReqValue & 1;
|
||||||
Ready = b;
|
Ready = b;
|
||||||
|
/*
|
||||||
if (b) dtr << LED_ON;
|
if (b) dtr << LED_ON;
|
||||||
else dtr << LED_OFF;
|
else dtr << LED_OFF;
|
||||||
|
*/
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case CDC_SEND_BREAK:
|
case CDC_SEND_BREAK:
|
||||||
|
|
|
@ -37,7 +37,7 @@ static_assert (DEF_UEP_NUM == 8, "Number endpoints fail");
|
||||||
*/
|
*/
|
||||||
class cdc_class : public BaseLayer {
|
class cdc_class : public BaseLayer {
|
||||||
CDC_CtrlInterface * CtrlIface;
|
CDC_CtrlInterface * CtrlIface;
|
||||||
GpioClass dtr;
|
// GpioClass dtr;
|
||||||
FIFO<char, 128> TxRing;
|
FIFO<char, 128> TxRing;
|
||||||
volatile bool Ready;
|
volatile bool Ready;
|
||||||
USB_CDC_LineCoding LineCoding;
|
USB_CDC_LineCoding LineCoding;
|
||||||
|
|
|
@ -24,7 +24,7 @@ class GpioClass {
|
||||||
GPIOA_Type & port;
|
GPIOA_Type & port;
|
||||||
const uint32_t pin;
|
const uint32_t pin;
|
||||||
public:
|
public:
|
||||||
explicit constexpr GpioClass (GPIOA_Type & _port, const uint32_t _pin, const uint32_t _mode = GPIO_AI_PPO | GPIO_Speed_10MHz) noexcept
|
explicit GpioClass (GPIOA_Type & _port, const uint32_t _pin, const uint32_t _mode = GPIO_AI_PPO | GPIO_Speed_10MHz) noexcept
|
||||||
: port(_port), pin(_pin) {
|
: port(_port), pin(_pin) {
|
||||||
/* Zapneme vše, ono je to dost jedno. */
|
/* Zapneme vše, ono je to dost jedno. */
|
||||||
RCC.APB2PCENR.modify([](RCC_Type::APB2PCENR_DEF & r)->auto {
|
RCC.APB2PCENR.modify([](RCC_Type::APB2PCENR_DEF & r)->auto {
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
#ifndef _PROJECT_CONFIG_H_
|
|
||||||
#define _PROJECT_CONFIG_H_
|
|
||||||
#define DEVEL_KIT
|
|
||||||
#ifdef DEVEL_KIT
|
|
||||||
#define DTR_LED GPIOA,0
|
|
||||||
#define DRQ_LED GPIOA,1
|
|
||||||
#define LED_ON false
|
|
||||||
#define LED_OFF true
|
|
||||||
#else
|
|
||||||
#define DTR_LED GPIOB,5
|
|
||||||
#define DRQ_LED GPIOB,4
|
|
||||||
#define LED_ON true
|
|
||||||
#define LED_OFF false
|
|
||||||
#endif
|
|
||||||
#endif // _PROJECT_CONFIG_H_
|
|
Loading…
Reference in a new issue