enabled dimming over ADC input
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "LightTask.h"
|
||||
#include "LightState.h"
|
||||
#include "BSP_GPIO.h"
|
||||
#include "BSP_ADC.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -139,11 +140,6 @@ void MX_FREERTOS_Init(void) {
|
||||
UsbDataHandler_Start();
|
||||
ULOG_INFO("Setup CanDataTask");
|
||||
CanDataTask_start();
|
||||
ULOG_INFO("Setup CLS");
|
||||
CLS_Init();
|
||||
ULOG_INFO("Setup LightTask");
|
||||
LightTask_start();
|
||||
LightStateTask_start();
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
/* USER CODE BEGIN RTOS_EVENTS */
|
||||
@@ -206,6 +202,18 @@ void StartDefaultTask(void *argument)
|
||||
snprintf(INA_LOG, sizeof(INA_LOG),"Voltage[mV] %.2f Current[mA] %d P[W]: %.2f", voltage_V, current, power_W);
|
||||
ULOG_INFO(INA_LOG);
|
||||
|
||||
|
||||
|
||||
// Read the battery voltage
|
||||
float bus = BSP_ADC_ReadBusValue();
|
||||
float dimm = BSP_ADC_ReadDimmerValue();
|
||||
|
||||
// Print the battery voltage and dimmer value
|
||||
char output[64];
|
||||
snprintf(output,64,"Bus voltage: %.2fV, Dimmer voltage: %.2fV", bus, dimm);
|
||||
ULOG_INFO(output);
|
||||
|
||||
|
||||
}
|
||||
/* USER CODE END StartDefaultTask */
|
||||
}
|
||||
@@ -226,8 +234,7 @@ void WaitForStartConfirm_Task(void *argument) {
|
||||
osDelayUntil(tick);
|
||||
tick += delayTime;
|
||||
if(BSP_GPIO_K15isSet() || CanDataTask_gotCarCanMessage()) {
|
||||
BSP_GPIO_ClsOn();
|
||||
BSP_GPIO_RadioOn();
|
||||
BSP_POWER_FullPowerMode();
|
||||
ULOG_INFO("Power systems started");
|
||||
osThreadExit();
|
||||
|
||||
@@ -251,5 +258,19 @@ void WaitForStartConfirm_Task(void *argument) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// this is called from BSP_POWER_FullPowerMode
|
||||
// this function should start tasks that depend on the power being on
|
||||
void StartPowerTasks(void) {
|
||||
|
||||
ULOG_INFO("Setup CLS");
|
||||
CLS_Init();
|
||||
ULOG_INFO("Setup LightTask");
|
||||
LightTask_start();
|
||||
LightStateTask_start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE END Application */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user