Compare commits
2 Commits
d3d80a2062
...
927c318f54
| Author | SHA1 | Date | |
|---|---|---|---|
| 927c318f54 | |||
| ab8b1bfbbe |
@@ -83,7 +83,7 @@ class VirtualComPort {
|
|||||||
return hcdc->TxState != 0;
|
return hcdc->TxState != 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef INFO_LEDS
|
||||||
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_SET);
|
||||||
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_RESET);
|
||||||
#endif
|
#endif
|
||||||
@@ -98,7 +98,7 @@ class VirtualComPort {
|
|||||||
USBD_CDC_SetTxBuffer(&hUsbDeviceFS, const_cast<uint8_t*>(m_usbAsyncTxBuffer.data), m_usbAsyncTxBuffer.size);
|
USBD_CDC_SetTxBuffer(&hUsbDeviceFS, const_cast<uint8_t*>(m_usbAsyncTxBuffer.data), m_usbAsyncTxBuffer.size);
|
||||||
USBD_CDC_TransmitPacket(&hUsbDeviceFS);
|
USBD_CDC_TransmitPacket(&hUsbDeviceFS);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef INFO_LEDS
|
||||||
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_SET);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ class VirtualComPort {
|
|||||||
|
|
||||||
static int8_t CdcInit()
|
static int8_t CdcInit()
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifdef INFO_LEDS
|
||||||
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_SET);
|
||||||
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_RESET);
|
||||||
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_SET);
|
||||||
@@ -129,7 +129,7 @@ class VirtualComPort {
|
|||||||
|
|
||||||
static int8_t CdcDeInit()
|
static int8_t CdcDeInit()
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifdef INFO_LEDS
|
||||||
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_RESET);
|
||||||
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_SET);
|
||||||
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_SET);
|
||||||
@@ -196,7 +196,7 @@ class VirtualComPort {
|
|||||||
|
|
||||||
static int8_t CdcReceive([[maybe_unused]] uint8_t* buf, uint32_t* length)
|
static int8_t CdcReceive([[maybe_unused]] uint8_t* buf, uint32_t* length)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifdef INFO_LEDS
|
||||||
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_SET);
|
||||||
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_RESET);
|
||||||
#endif
|
#endif
|
||||||
@@ -208,7 +208,7 @@ class VirtualComPort {
|
|||||||
rxHandler(m_usbAsyncRxBuffer.data[i]);
|
rxHandler(m_usbAsyncRxBuffer.data[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef INFO_LEDS
|
||||||
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_SET);
|
||||||
#endif
|
#endif
|
||||||
return USBD_OK;
|
return USBD_OK;
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ TARGET = AdaptiveBrightnessFirmware
|
|||||||
# building variables
|
# building variables
|
||||||
######################################
|
######################################
|
||||||
# debug build?
|
# debug build?
|
||||||
DEBUG = 1
|
DEBUG = 0
|
||||||
# optimization
|
# optimization
|
||||||
OPT = -Og
|
OPT = -Os
|
||||||
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
@@ -126,12 +126,14 @@ AS_DEFS =
|
|||||||
# C defines
|
# C defines
|
||||||
C_DEFS = \
|
C_DEFS = \
|
||||||
-DUSE_HAL_DRIVER \
|
-DUSE_HAL_DRIVER \
|
||||||
-DSTM32F042x6
|
-DSTM32F042x6 \
|
||||||
|
-DINFO_LEDS
|
||||||
|
|
||||||
# C++ defines
|
# C++ defines
|
||||||
CXX_DEFS = \
|
CXX_DEFS = \
|
||||||
-DUSE_HAL_DRIVER \
|
-DUSE_HAL_DRIVER \
|
||||||
-DSTM32F042x6
|
-DSTM32F042x6 \
|
||||||
|
-DINFO_LEDS
|
||||||
|
|
||||||
|
|
||||||
# AS includes
|
# AS includes
|
||||||
|
|||||||
Reference in New Issue
Block a user