added LightState Switch

This commit is contained in:
2024-05-20 17:44:56 +02:00
parent e995e1bd01
commit 25fb6d0a1e
8 changed files with 100 additions and 16 deletions

View File

@@ -36,6 +36,7 @@
#include "BSP_INA.h"
#include "BSP_POWER.h"
#include "LightTask.h"
#include "LightState.h"
#include "BSP_GPIO.h"
/* USER CODE END Includes */
@@ -69,7 +70,7 @@ const osThreadAttr_t defaultTask_attributes = {
osThreadId_t waitForStartConfirmHandle;
const osThreadAttr_t waitForStartConfirm_attributes = {
.name = "waitForStartConfirm",
.stack_size = 128 * 4,
.stack_size = 256 * 4,
.priority = (osPriority_t) osPriorityNormal,
};
@@ -142,6 +143,7 @@ void MX_FREERTOS_Init(void) {
CLS_Init();
ULOG_INFO("Setup LightTask");
LightTask_start();
LightStateTask_start();
/* USER CODE END RTOS_THREADS */
/* USER CODE BEGIN RTOS_EVENTS */
@@ -228,14 +230,23 @@ void WaitForStartConfirm_Task(void *argument) {
BSP_GPIO_RadioOn();
ULOG_INFO("Power systems started");
osThreadExit();
return;
while (1)
{
osDelay(1000);
}
}
if(tick > maxDelayTime) {
BSP_POWER_EnterStandby();
ULOG_INFO("System in standby mode");
osThreadExit();
return;
while (1)
{
osDelay(1000);
}
}
}
}

View File

@@ -348,8 +348,8 @@ void Error_Handler(void)
ULOG_ERROR("Error Handler");
osThreadId_t error_thread = osThreadGetId();
if(error_thread != NULL) {
const char * osThreadGetName(error_thread);
ULOG_ERROR("Error in thread: %s", osThreadGetName(error_thread));
const char * thread_name = osThreadGetName(error_thread);
ULOG_ERROR("Error in thread: %s", thread_name);
}
__disable_irq();
while (1)