commit eb00b138812f074c01a2a0a0a7d2b1fcef7dc10a
parent 2aaff44710acd6cbc2c69d454b4b27b36f8a3cf8
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date: Sat, 28 Mar 2026 18:50:20 -0300
Agregar un LED externo en `task_led`
Diffstat:
6 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/firmware/Core/Inc/main.h b/firmware/Core/Inc/main.h
@@ -78,6 +78,8 @@ void Error_Handler(void);
#define LD2_GPIO_Port GPIOA
#define BTN_B_Pin GPIO_PIN_10
#define BTN_B_GPIO_Port GPIOB
+#define LD3_Pin GPIO_PIN_10
+#define LD3_GPIO_Port GPIOA
#define TMS_Pin GPIO_PIN_13
#define TMS_GPIO_Port GPIOA
#define TCK_Pin GPIO_PIN_14
diff --git a/firmware/Core/Src/main.c b/firmware/Core/Src/main.c
@@ -436,7 +436,7 @@ static void MX_GPIO_Init(void)
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOA, LD2_Pin|LD3_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin : BTN_A_Pin */
GPIO_InitStruct.Pin = BTN_A_Pin;
@@ -450,12 +450,12 @@ static void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /*Configure GPIO pin : LD2_Pin */
- GPIO_InitStruct.Pin = LD2_Pin;
+ /*Configure GPIO pins : LD2_Pin LD3_Pin */
+ GPIO_InitStruct.Pin = LD2_Pin|LD3_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
- HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pins : BTN_B_Pin BTN_C_Pin BTN_D_Pin */
GPIO_InitStruct.Pin = BTN_B_Pin|BTN_C_Pin|BTN_D_Pin;
diff --git a/firmware/app/inc/task_led_attribute.h b/firmware/app/inc/task_led_attribute.h
@@ -85,6 +85,7 @@ typedef enum {
/* Identifier of Task Led */
typedef enum {
ID_LED_A,
+ ID_LED_B
} task_led_id_t;
typedef struct
diff --git a/firmware/app/src/task_led.c b/firmware/app/src/task_led.c
@@ -30,14 +30,14 @@
const task_led_cfg_t task_led_cfg_list[] = {
{ID_LED_A, LD2_GPIO_Port, LD2_Pin, LED_ON, LED_OFF, DEL_LED_XX_BLI, DEL_LED_XX_PUL},
- // {ID_LED_B, LED_A_GPIO_Port, LED_A_Pin, LED_ON, LED_OFF, DEL_LED_XX_BLI, DEL_LED_XX_PUL},
+ {ID_LED_B, LD3_GPIO_Port, LD3_Pin, LED_ON, LED_OFF, DEL_LED_XX_BLI, DEL_LED_XX_PUL},
};
#define LED_CFG_QTY (sizeof(task_led_cfg_list)/sizeof(task_led_cfg_t))
task_led_dta_t task_led_dta_list[] = {
{DEL_LED_XX_MIN, ST_LED_XX_OFF, EV_LED_XX_NOT_BLINK, false},
- // {DEL_LED_XX_MIN, ST_LED_XX_OFF, EV_LED_XX_NOT_BLINK, false}
+ {DEL_LED_XX_MIN, ST_LED_XX_OFF, EV_LED_XX_NOT_BLINK, false},
};
#define LED_DTA_QTY (sizeof(task_led_dta_list)/sizeof(task_led_dta_t))
diff --git a/firmware/app/src/task_system.c b/firmware/app/src/task_system.c
@@ -160,6 +160,7 @@ void task_system_statechart(void *parameters)
p_task_system_dta->state = ST_SYS_CLOCK;
task_menu_interface_put_event(EV_MEN_ST_CLOCK);
task_led_interface_put_event(EV_LED_XX_BLINK, ID_LED_A);
+ task_led_interface_put_event(EV_LED_XX_BLINK, ID_LED_B);
break;
default: break;
}
@@ -177,6 +178,7 @@ void task_system_statechart(void *parameters)
p_task_system_dta->state = ST_SYS_IDLE;
task_menu_interface_put_event(EV_MEN_ST_IDLE);
task_led_interface_put_event(EV_LED_XX_OFF, ID_LED_A);
+ task_led_interface_put_event(EV_LED_XX_OFF, ID_LED_B);
break;
case EV_SYS_BTN_B_ACTIVE:
task_system_rtc_increment_hour();
diff --git a/firmware/tdse-tf_3-02.ioc b/firmware/tdse-tf_3-02.ioc
@@ -52,19 +52,20 @@ Mcu.Package=LQFP64
Mcu.Pin0=PC13-TAMPER-RTC
Mcu.Pin1=PC14-OSC32_IN
Mcu.Pin10=PA9
-Mcu.Pin11=PA13
-Mcu.Pin12=PA14
-Mcu.Pin13=PB3
-Mcu.Pin14=PB4
-Mcu.Pin15=PB5
-Mcu.Pin16=PB8
-Mcu.Pin17=PB9
-Mcu.Pin18=VP_RTC_VS_RTC_Activate
-Mcu.Pin19=VP_RTC_VS_RTC_Calendar
+Mcu.Pin11=PA10
+Mcu.Pin12=PA13
+Mcu.Pin13=PA14
+Mcu.Pin14=PB3
+Mcu.Pin15=PB4
+Mcu.Pin16=PB5
+Mcu.Pin17=PB8
+Mcu.Pin18=PB9
+Mcu.Pin19=VP_RTC_VS_RTC_Activate
Mcu.Pin2=PC15-OSC32_OUT
-Mcu.Pin20=VP_RTC_No_RTC_Output
-Mcu.Pin21=VP_SYS_VS_Systick
-Mcu.Pin22=VP_TIM1_VS_ClockSourceINT
+Mcu.Pin20=VP_RTC_VS_RTC_Calendar
+Mcu.Pin21=VP_RTC_No_RTC_Output
+Mcu.Pin22=VP_SYS_VS_Systick
+Mcu.Pin23=VP_TIM1_VS_ClockSourceINT
Mcu.Pin3=PD0-OSC_IN
Mcu.Pin4=PD1-OSC_OUT
Mcu.Pin5=PA2
@@ -72,7 +73,7 @@ Mcu.Pin6=PA3
Mcu.Pin7=PA5
Mcu.Pin8=PB10
Mcu.Pin9=PA8
-Mcu.PinsNb=23
+Mcu.PinsNb=24
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F103RBTx
@@ -96,6 +97,10 @@ NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
NVIC.USART1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+PA10.GPIOParameters=GPIO_Label
+PA10.GPIO_Label=LD3
+PA10.Locked=true
+PA10.Signal=GPIO_Output
PA13.GPIOParameters=GPIO_Label
PA13.GPIO_Label=TMS
PA13.Locked=true
@@ -121,7 +126,7 @@ PA3.GPIO_Speed=GPIO_SPEED_FREQ_LOW
PA3.Locked=true
PA3.Signal=USART2_RX
PA5.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
-PA5.GPIO_Label=LD2 [Green Led]
+PA5.GPIO_Label=LD2 [Built-in]
PA5.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
PA5.GPIO_PuPd=GPIO_NOPULL
PA5.GPIO_Speed=GPIO_SPEED_FREQ_LOW
@@ -206,7 +211,7 @@ ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=true
-ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_RTC_Init-RTC-false-HAL-true,6-MX_I2C1_Init-I2C1-false-HAL-true
+ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_RTC_Init-RTC-false-HAL-true,6-MX_I2C1_Init-I2C1-false-HAL-true,7-MX_TIM1_Init-TIM1-false-HAL-true
RCC.ADCFreqValue=32000000
RCC.AHBFreq_Value=64000000
RCC.APB1CLKDivider=RCC_HCLK_DIV2