added LightState Switch
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user