added ambient light to can bus
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user