added ambient light to can bus
This commit is contained in:
Submodule Application/CLS updated: 4744762b4c...58b50b2fb3
@@ -7,7 +7,7 @@
|
||||
#include "CLS.h"
|
||||
#include "CLS_BSP.h"
|
||||
#include "CLSAddress.h"
|
||||
|
||||
#include "ulog.h"
|
||||
|
||||
cls_headlight_RequestSettings msg_cls_headlight_RequestSettings;
|
||||
cls_headlight_Settings msg_cls_headlight_Settings;
|
||||
@@ -20,6 +20,21 @@ typedef struct Headlight_Control_Setting {
|
||||
uint16_t off_threshold;
|
||||
} Headlight_Control_Setting_t;
|
||||
|
||||
|
||||
uint16_t headlight_amblight = 0;
|
||||
|
||||
void CanData_ambilight(CanDataId canid, uint8_t* data, uint8_t len) {
|
||||
if(len == 2) {
|
||||
headlight_amblight = (data[1] << 8) | data[0];
|
||||
}
|
||||
|
||||
ULOG_INFO("Ambilight: %d", headlight_amblight);
|
||||
}
|
||||
|
||||
void AddHeadlightMessages() {
|
||||
CanData_regEventMsg(GENERATE_CLS_ADDRESS(CLS_CODE_STATUS, 0, CLS_CH_STA_AMBIENTLIGHT), CanData_ambilight);
|
||||
}
|
||||
|
||||
// whan a message is received, this function is called
|
||||
void DataClbk_cls_headlight_Settings(void* msg, uint32_t length) {
|
||||
DATA_CLBK_SETUP(cls_headlight_Settings);
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "BSP_ADC.h"
|
||||
#include "BSP_SDLogger.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -151,6 +152,8 @@ void MX_FREERTOS_Init(void) {
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
void AddHeadlightMessages();
|
||||
|
||||
/**
|
||||
* @brief Function implementing the defaultTask thread.
|
||||
* @param argument: Not used
|
||||
@@ -189,6 +192,7 @@ void StartDefaultTask(void *argument)
|
||||
}
|
||||
|
||||
BSP_SDLogger_Init(counter);
|
||||
AddHeadlightMessages();
|
||||
|
||||
char INA_LOG[72];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user