added leds light

This commit is contained in:
2026-04-01 22:18:27 +03:00
parent d43458c770
commit 1aa5ada734
9 changed files with 6914 additions and 6905 deletions

View File

@@ -1,38 +1,40 @@
../SubGHz_Phy/App/subghz_phy_app.c:125:6:SubghzApp_Init 2
../SubGHz_Phy/App/subghz_phy_app.c:151:6:SubghzApp_Process 1
../SubGHz_Phy/App/subghz_phy_app.c:160:13:App_ProcessRadioEvents 10
../SubGHz_Phy/App/subghz_phy_app.c:211:13:App_ProcessUartPacketizer 5
../SubGHz_Phy/App/subghz_phy_app.c:228:13:App_ProcessEscape 8
../SubGHz_Phy/App/subghz_phy_app.c:257:13:App_StartNextTxIfPossible 4
../SubGHz_Phy/App/subghz_phy_app.c:269:13:App_ApplyConfig 2
../SubGHz_Phy/App/subghz_phy_app.c:280:13:App_RadioApplyConfig 1
../SubGHz_Phy/App/subghz_phy_app.c:286:13:App_RadioConfigureRx 2
../SubGHz_Phy/App/subghz_phy_app.c:316:13:App_RadioConfigureTx 2
../SubGHz_Phy/App/subghz_phy_app.c:342:13:App_RadioEnterRx 1
../SubGHz_Phy/App/subghz_phy_app.c:348:13:App_EnterConfigMode 2
../SubGHz_Phy/App/subghz_phy_app.c:364:13:App_ExitConfigMode 1
../SubGHz_Phy/App/subghz_phy_app.c:373:13:App_ResetDataPath 1
../SubGHz_Phy/App/subghz_phy_app.c:383:13:App_DataModeFeedByte 3
../SubGHz_Phy/App/subghz_phy_app.c:403:13:App_DataModeFlushBuilder 3
../SubGHz_Phy/App/subghz_phy_app.c:417:16:App_QueuePush 4
../SubGHz_Phy/App/subghz_phy_app.c:431:13:App_QueuePop 2
../SubGHz_Phy/App/subghz_phy_app.c:442:13:UartRxByteCallback 13
../SubGHz_Phy/App/subghz_phy_app.c:505:13:App_ConfigFeedByte 9
../SubGHz_Phy/App/subghz_phy_app.c:537:13:App_ConfigExecuteLine 34
../SubGHz_Phy/App/subghz_phy_app.c:699:13:App_PrintConfigPrompt 2
../SubGHz_Phy/App/subghz_phy_app.c:707:13:App_PrintHelp 1
../SubGHz_Phy/App/subghz_phy_app.c:726:13:App_PrintStatus 2
../SubGHz_Phy/App/subghz_phy_app.c:748:13:App_Printf 3
../SubGHz_Phy/App/subghz_phy_app.c:771:13:App_Write 3
../SubGHz_Phy/App/subghz_phy_app.c:781:13:App_ReconfigureUart 5
../SubGHz_Phy/App/subghz_phy_app.c:807:16:App_ParseHexSyncWord 11
../SubGHz_Phy/App/subghz_phy_app.c:855:14:App_SkipSpaces 4
../SubGHz_Phy/App/subghz_phy_app.c:864:13:App_LedTxPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:871:13:App_LedRxPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:878:13:App_LedErrPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:885:13:App_ProcessLeds 7
../SubGHz_Phy/App/subghz_phy_app.c:909:13:OnTxDone 1
../SubGHz_Phy/App/subghz_phy_app.c:914:13:OnRxDone 2
../SubGHz_Phy/App/subghz_phy_app.c:929:13:OnTxTimeout 1
../SubGHz_Phy/App/subghz_phy_app.c:934:13:OnRxTimeout 1
../SubGHz_Phy/App/subghz_phy_app.c:939:13:OnRxError 1
../SubGHz_Phy/App/subghz_phy_app.c:159:6:SubghzApp_Process 1
../SubGHz_Phy/App/subghz_phy_app.c:167:13:App_ProcessRadioEvents 10
../SubGHz_Phy/App/subghz_phy_app.c:218:13:App_ProcessUartPacketizer 5
../SubGHz_Phy/App/subghz_phy_app.c:235:13:App_ProcessEscape 8
../SubGHz_Phy/App/subghz_phy_app.c:264:13:App_StartNextTxIfPossible 4
../SubGHz_Phy/App/subghz_phy_app.c:276:13:App_ApplyConfig 2
../SubGHz_Phy/App/subghz_phy_app.c:287:13:App_RadioApplyConfig 1
../SubGHz_Phy/App/subghz_phy_app.c:293:13:App_RadioConfigureRx 2
../SubGHz_Phy/App/subghz_phy_app.c:323:13:App_RadioConfigureTx 2
../SubGHz_Phy/App/subghz_phy_app.c:349:13:App_RadioEnterRx 1
../SubGHz_Phy/App/subghz_phy_app.c:355:13:App_EnterConfigMode 2
../SubGHz_Phy/App/subghz_phy_app.c:371:13:App_ExitConfigMode 1
../SubGHz_Phy/App/subghz_phy_app.c:380:13:App_ResetDataPath 1
../SubGHz_Phy/App/subghz_phy_app.c:390:13:App_DataModeFeedByte 3
../SubGHz_Phy/App/subghz_phy_app.c:410:13:App_DataModeFlushBuilder 3
../SubGHz_Phy/App/subghz_phy_app.c:424:16:App_QueuePush 4
../SubGHz_Phy/App/subghz_phy_app.c:438:13:App_QueuePop 2
../SubGHz_Phy/App/subghz_phy_app.c:449:13:UartRxByteCallback 13
../SubGHz_Phy/App/subghz_phy_app.c:512:13:App_ConfigFeedByte 9
../SubGHz_Phy/App/subghz_phy_app.c:544:13:App_ConfigExecuteLine 34
../SubGHz_Phy/App/subghz_phy_app.c:706:13:App_PrintConfigPrompt 2
../SubGHz_Phy/App/subghz_phy_app.c:714:13:App_PrintHelp 1
../SubGHz_Phy/App/subghz_phy_app.c:733:13:App_PrintStatus 2
../SubGHz_Phy/App/subghz_phy_app.c:755:13:App_Printf 3
../SubGHz_Phy/App/subghz_phy_app.c:778:13:App_Write 3
../SubGHz_Phy/App/subghz_phy_app.c:788:13:App_ReconfigureUart 5
../SubGHz_Phy/App/subghz_phy_app.c:814:16:App_ParseHexSyncWord 11
../SubGHz_Phy/App/subghz_phy_app.c:862:14:App_SkipSpaces 4
../SubGHz_Phy/App/subghz_phy_app.c:870:13:App_LedTxPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:878:13:App_LedRxPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:886:13:App_LedErrPulse 1
../SubGHz_Phy/App/subghz_phy_app.c:893:13:OnTxDone 1
../SubGHz_Phy/App/subghz_phy_app.c:898:13:App_LedTxOff 1
../SubGHz_Phy/App/subghz_phy_app.c:904:13:App_LedRxOff 1
../SubGHz_Phy/App/subghz_phy_app.c:910:13:App_LedErrOff 1
../SubGHz_Phy/App/subghz_phy_app.c:917:13:OnRxDone 2
../SubGHz_Phy/App/subghz_phy_app.c:932:13:OnTxTimeout 1
../SubGHz_Phy/App/subghz_phy_app.c:937:13:OnRxTimeout 1
../SubGHz_Phy/App/subghz_phy_app.c:942:13:OnRxError 1

View File

@@ -52,7 +52,8 @@ SubGHz_Phy/App/subghz_phy_app.o: ../SubGHz_Phy/App/subghz_phy_app.c \
../Core/Inc/utilities_conf.h ../Drivers/CMSIS/Include/cmsis_compiler.h \
../Utilities/misc/stm32_mem.h ../Utilities/misc/stm32_tiny_vsnprintf.h \
../Core/Inc/utilities_def.h ../Core/Inc/usart.h ../Core/Inc/dma.h \
../Core/Inc/usart.h ../Core/Inc/main.h \
../Core/Inc/usart.h ../Core/Inc/main.h ../SubGHz_Phy/Target/timer.h \
../Utilities/timer/stm32_timer.h \
../SubGHz_Phy/App/config/config_consts.h \
../SubGHz_Phy/App/config/config_types.h \
../SubGHz_Phy/App/config/config_consts.h \
@@ -119,6 +120,8 @@ SubGHz_Phy/App/subghz_phy_app.o: ../SubGHz_Phy/App/subghz_phy_app.c \
../Core/Inc/dma.h:
../Core/Inc/usart.h:
../Core/Inc/main.h:
../SubGHz_Phy/Target/timer.h:
../Utilities/timer/stm32_timer.h:
../SubGHz_Phy/App/config/config_consts.h:
../SubGHz_Phy/App/config/config_types.h:
../SubGHz_Phy/App/config/config_consts.h:

View File

@@ -1,38 +1,40 @@
../SubGHz_Phy/App/subghz_phy_app.c:125:6:SubghzApp_Init 8 static
../SubGHz_Phy/App/subghz_phy_app.c:151:6:SubghzApp_Process 8 static
../SubGHz_Phy/App/subghz_phy_app.c:160:13:App_ProcessRadioEvents 8 static
../SubGHz_Phy/App/subghz_phy_app.c:211:13:App_ProcessUartPacketizer 16 static
../SubGHz_Phy/App/subghz_phy_app.c:228:13:App_ProcessEscape 16 static
../SubGHz_Phy/App/subghz_phy_app.c:257:13:App_StartNextTxIfPossible 16 static
../SubGHz_Phy/App/subghz_phy_app.c:269:13:App_ApplyConfig 8 static
../SubGHz_Phy/App/subghz_phy_app.c:280:13:App_RadioApplyConfig 8 static
../SubGHz_Phy/App/subghz_phy_app.c:286:13:App_RadioConfigureRx 72 static
../SubGHz_Phy/App/subghz_phy_app.c:316:13:App_RadioConfigureTx 48 static
../SubGHz_Phy/App/subghz_phy_app.c:342:13:App_RadioEnterRx 8 static
../SubGHz_Phy/App/subghz_phy_app.c:348:13:App_EnterConfigMode 8 static
../SubGHz_Phy/App/subghz_phy_app.c:364:13:App_ExitConfigMode 8 static
../SubGHz_Phy/App/subghz_phy_app.c:373:13:App_ResetDataPath 4 static
../SubGHz_Phy/App/subghz_phy_app.c:383:13:App_DataModeFeedByte 16 static
../SubGHz_Phy/App/subghz_phy_app.c:403:13:App_DataModeFlushBuilder 8 static
../SubGHz_Phy/App/subghz_phy_app.c:417:16:App_QueuePush 16 static
../SubGHz_Phy/App/subghz_phy_app.c:431:13:App_QueuePop 4 static
../SubGHz_Phy/App/subghz_phy_app.c:442:13:UartRxByteCallback 24 static
../SubGHz_Phy/App/subghz_phy_app.c:505:13:App_ConfigFeedByte 16 static
../SubGHz_Phy/App/subghz_phy_app.c:537:13:App_ConfigExecuteLine 32 static
../SubGHz_Phy/App/subghz_phy_app.c:699:13:App_PrintConfigPrompt 8 static
../SubGHz_Phy/App/subghz_phy_app.c:707:13:App_PrintHelp 8 static
../SubGHz_Phy/App/subghz_phy_app.c:726:13:App_PrintStatus 8 static
../SubGHz_Phy/App/subghz_phy_app.c:748:13:App_Printf 208 static
../SubGHz_Phy/App/subghz_phy_app.c:771:13:App_Write 16 static
../SubGHz_Phy/App/subghz_phy_app.c:781:13:App_ReconfigureUart 16 static
../SubGHz_Phy/App/subghz_phy_app.c:807:16:App_ParseHexSyncWord 40 static
../SubGHz_Phy/App/subghz_phy_app.c:855:14:App_SkipSpaces 16 static
../SubGHz_Phy/App/subghz_phy_app.c:864:13:App_LedTxPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:871:13:App_LedRxPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:878:13:App_LedErrPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:885:13:App_ProcessLeds 16 static
../SubGHz_Phy/App/subghz_phy_app.c:909:13:OnTxDone 4 static
../SubGHz_Phy/App/subghz_phy_app.c:914:13:OnRxDone 24 static
../SubGHz_Phy/App/subghz_phy_app.c:929:13:OnTxTimeout 4 static
../SubGHz_Phy/App/subghz_phy_app.c:934:13:OnRxTimeout 4 static
../SubGHz_Phy/App/subghz_phy_app.c:939:13:OnRxError 4 static
../SubGHz_Phy/App/subghz_phy_app.c:125:6:SubghzApp_Init 16 static
../SubGHz_Phy/App/subghz_phy_app.c:159:6:SubghzApp_Process 8 static
../SubGHz_Phy/App/subghz_phy_app.c:167:13:App_ProcessRadioEvents 8 static
../SubGHz_Phy/App/subghz_phy_app.c:218:13:App_ProcessUartPacketizer 16 static
../SubGHz_Phy/App/subghz_phy_app.c:235:13:App_ProcessEscape 16 static
../SubGHz_Phy/App/subghz_phy_app.c:264:13:App_StartNextTxIfPossible 16 static
../SubGHz_Phy/App/subghz_phy_app.c:276:13:App_ApplyConfig 8 static
../SubGHz_Phy/App/subghz_phy_app.c:287:13:App_RadioApplyConfig 8 static
../SubGHz_Phy/App/subghz_phy_app.c:293:13:App_RadioConfigureRx 72 static
../SubGHz_Phy/App/subghz_phy_app.c:323:13:App_RadioConfigureTx 48 static
../SubGHz_Phy/App/subghz_phy_app.c:349:13:App_RadioEnterRx 8 static
../SubGHz_Phy/App/subghz_phy_app.c:355:13:App_EnterConfigMode 8 static
../SubGHz_Phy/App/subghz_phy_app.c:371:13:App_ExitConfigMode 8 static
../SubGHz_Phy/App/subghz_phy_app.c:380:13:App_ResetDataPath 4 static
../SubGHz_Phy/App/subghz_phy_app.c:390:13:App_DataModeFeedByte 16 static
../SubGHz_Phy/App/subghz_phy_app.c:410:13:App_DataModeFlushBuilder 8 static
../SubGHz_Phy/App/subghz_phy_app.c:424:16:App_QueuePush 16 static
../SubGHz_Phy/App/subghz_phy_app.c:438:13:App_QueuePop 4 static
../SubGHz_Phy/App/subghz_phy_app.c:449:13:UartRxByteCallback 24 static
../SubGHz_Phy/App/subghz_phy_app.c:512:13:App_ConfigFeedByte 16 static
../SubGHz_Phy/App/subghz_phy_app.c:544:13:App_ConfigExecuteLine 32 static
../SubGHz_Phy/App/subghz_phy_app.c:706:13:App_PrintConfigPrompt 8 static
../SubGHz_Phy/App/subghz_phy_app.c:714:13:App_PrintHelp 8 static
../SubGHz_Phy/App/subghz_phy_app.c:733:13:App_PrintStatus 8 static
../SubGHz_Phy/App/subghz_phy_app.c:755:13:App_Printf 208 static
../SubGHz_Phy/App/subghz_phy_app.c:778:13:App_Write 16 static
../SubGHz_Phy/App/subghz_phy_app.c:788:13:App_ReconfigureUart 16 static
../SubGHz_Phy/App/subghz_phy_app.c:814:16:App_ParseHexSyncWord 40 static
../SubGHz_Phy/App/subghz_phy_app.c:862:14:App_SkipSpaces 16 static
../SubGHz_Phy/App/subghz_phy_app.c:870:13:App_LedTxPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:878:13:App_LedRxPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:886:13:App_LedErrPulse 8 static
../SubGHz_Phy/App/subghz_phy_app.c:893:13:OnTxDone 4 static
../SubGHz_Phy/App/subghz_phy_app.c:898:13:App_LedTxOff 16 static
../SubGHz_Phy/App/subghz_phy_app.c:904:13:App_LedRxOff 16 static
../SubGHz_Phy/App/subghz_phy_app.c:910:13:App_LedErrOff 16 static
../SubGHz_Phy/App/subghz_phy_app.c:917:13:OnRxDone 24 static
../SubGHz_Phy/App/subghz_phy_app.c:932:13:OnTxTimeout 4 static
../SubGHz_Phy/App/subghz_phy_app.c:937:13:OnRxTimeout 4 static
../SubGHz_Phy/App/subghz_phy_app.c:942:13:OnRxError 4 static

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@
#include "usart_if.h"
#include "usart.h"
#include "main.h"
#include "timer.h"
#include "config/config_consts.h"
#include "config/config_types.h"
@@ -49,9 +50,9 @@ static volatile uint8_t g_radio_rx_error = 0;
static volatile int16_t g_last_rx_rssi = 0;
static volatile int8_t g_last_rx_cfo = 0;
static volatile uint8_t g_led_tx_ticks = 0U;
static volatile uint8_t g_led_rx_ticks = 0U;
static volatile uint8_t g_led_err_ticks = 0U;
static TimerEvent_t g_led_tx_timer;
static TimerEvent_t g_led_rx_timer;
static TimerEvent_t g_led_err_timer;
static volatile uint8_t g_radio_busy = 0;
static volatile uint8_t g_radio_needs_rx_restart = 0;
@@ -90,6 +91,10 @@ static void App_LedTxPulse(void);
static void App_LedRxPulse(void);
static void App_LedErrPulse(void);
static void App_LedTxOff(void *context);
static void App_LedRxOff(void *context);
static void App_LedErrOff(void *context);
static void UartRxByteCallback(uint8_t *rxChar, uint16_t size, uint8_t error);
static void App_ProcessRadioEvents(void);
static void App_ProcessUartPacketizer(void);
@@ -132,6 +137,10 @@ void SubghzApp_Init(void)
Radio.Init(&RadioEvents);
TimerInit(&g_led_tx_timer, App_LedTxOff);
TimerInit(&g_led_rx_timer, App_LedRxOff);
TimerInit(&g_led_err_timer, App_LedErrOff);
App_RadioApplyConfig();
App_ReconfigureUart(g_cfg.uart_baudrate);
App_RadioEnterRx();
@@ -140,10 +149,6 @@ void SubghzApp_Init(void)
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
g_led_tx_ticks = 0U;
g_led_rx_ticks = 0U;
g_led_err_ticks = 0U;
g_uart_last_data_tick = HAL_GetTick();
(void)vcom_ReceiveInit(UartRxByteCallback);
@@ -862,67 +867,53 @@ static char *App_SkipSpaces(char *s)
}
return s;
}
void SubghzApp_Timer1msIrq(void)
{
if (g_led_tx_ticks > 0U)
{
g_led_tx_ticks--;
if (g_led_tx_ticks == 0U)
{
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);
}
}
if (g_led_rx_ticks > 0U)
{
g_led_rx_ticks--;
if (g_led_rx_ticks == 0U)
{
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);
}
}
if (g_led_err_ticks > 0U)
{
g_led_err_ticks--;
if (g_led_err_ticks == 0U)
{
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
}
}
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if (htim->Instance == TIM2) // замени на свой таймер
{
SubghzApp_Timer1msIrq();
}
}
static void App_LedTxPulse(void)
{
TimerStop(&g_led_tx_timer);
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);
g_led_tx_ticks = LED_PULSE_MS;
TimerSetValue(&g_led_tx_timer, LED_PULSE_MS);
TimerStart(&g_led_tx_timer);
}
static void App_LedRxPulse(void)
{
TimerStop(&g_led_rx_timer);
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET);
g_led_rx_ticks = LED_PULSE_MS;
TimerSetValue(&g_led_rx_timer, LED_PULSE_MS);
TimerStart(&g_led_rx_timer);
}
static void App_LedErrPulse(void)
{
TimerStop(&g_led_err_timer);
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);
g_led_err_ticks = LED_PULSE_MS;
TimerSetValue(&g_led_err_timer, LED_PULSE_MS);
TimerStart(&g_led_err_timer);
}
static void OnTxDone(void)
{
g_radio_tx_done = 1U;
}
static void App_LedTxOff(void *context)
{
(void)context;
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);
}
static void App_LedRxOff(void *context)
{
(void)context;
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);
}
static void App_LedErrOff(void *context)
{
(void)context;
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET);
}
static void OnRxDone(uint8_t *payload, uint16_t size, int16_t rssi, int8_t cfo)
{
g_last_rx_rssi = rssi;