use const brightness
This commit is contained in:
@@ -77,19 +77,19 @@ void LightTask_func(void *argument) {
|
||||
|
||||
|
||||
// calculate the brightness to send
|
||||
uint8_t brightness = lightSettings.brightness;
|
||||
//uint8_t brightness = lightSettings.brightness;
|
||||
// Read ADC battery voltage and dimmer voltage
|
||||
|
||||
|
||||
|
||||
float dimmfactor = 1.0;
|
||||
//float dimmfactor = 1.0;
|
||||
|
||||
// only dimm if the headlight is on
|
||||
if (BSP_GPIO_HeadLightIsSet()) {
|
||||
//if (BSP_GPIO_HeadLightIsSet()) {
|
||||
|
||||
// new version over CAN
|
||||
uint8_t precent = CanDataTask_CarCanBrightness();
|
||||
dimmfactor = (float)precent / 100.0;
|
||||
//uint8_t precent = CanDataTask_CarCanBrightness();
|
||||
//dimmfactor = (float)precent / 100.0;
|
||||
|
||||
// old version over ADC
|
||||
// calculate the dimmfactor based on the battery voltage and the dimmer voltage
|
||||
@@ -106,12 +106,12 @@ void LightTask_func(void *argument) {
|
||||
//}
|
||||
}
|
||||
|
||||
uint8_t adjustedBrightness = (uint8_t)(brightness * dimmfactor);
|
||||
lightSettings_dimmed.brightness = adjustedBrightness;
|
||||
lightSettings_dimmed.theme = lightSettings.theme;
|
||||
//uint8_t adjustedBrightness = (uint8_t)(brightness * dimmfactor);
|
||||
//lightSettings_dimmed.brightness = adjustedBrightness;
|
||||
//lightSettings_dimmed.theme = lightSettings.theme;
|
||||
|
||||
|
||||
CLS_BSP_CAN_AddMessageToSend(&can_header,(uint8_t*)&lightSettings_dimmed);
|
||||
lightSettings.brightness = 255;
|
||||
CLS_BSP_CAN_AddMessageToSend(&can_header,(uint8_t*)&lightSettings);
|
||||
|
||||
if( settingChangeTime !=0 && tick > settingChangeTime + settingSaveTimeout) {
|
||||
BSP_EE24_PartWrite(BSP_EE24_PART_GLOBAL_LIGHT, (uint8_t*) &lightSettings, sizeof(lightSettings));
|
||||
|
||||
Reference in New Issue
Block a user