
#include "BackLight.h"
#include "Components.h"

#define BACK_LIGHT_DAY 600
#define BACK_LIGHT_NIGHT 200
#define BACK_LIGHT_Val_1 100
#define BACK_LIGHT_Val_2 200
#define BACK_LIGHT_Val_3 400
#define BACK_LIGHT_Val_4 600
#define BACK_LIGHT_Val_5 800

_Light g_Light;

void BackLight_Init(void)
{
    MenuInfor.BackLight_Val = BackLight_Val_2;
    g_Light.Light_Auto = 0XFFFF;
}

void BackLight_Process(void)
{
    if (SYS_OPR_STAT_IGN_ON)
    {
        //if(MenuInfor.BackLight_Val == BackLight_Val_A)
        //{
        //    //g_Light.Light_Auto = ALS_Get_Data1();
        //    if (g_Light.Light_Auto >= 1000)
        //    {
        //        g_Light.Light_Auto = 1000;
        //    }
        //    TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, g_Light.Light_Auto);
        //}
        //else if(MenuInfor.BackLight_Val == BackLight_Val_1)
        //{
        //    TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_1);
        //}
        //else if(MenuInfor.BackLight_Val == BackLight_Val_2)
        //{
        //    TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_2);
        //}
        //else if(MenuInfor.BackLight_Val == BackLight_Val_3)
        //{
        //    TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_3);
        //}
        //else if(MenuInfor.BackLight_Val == BackLight_Val_4)
        //{
        //    TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_4);
        //}
        //else if(MenuInfor.BackLight_Val == BackLight_Val_5)
        //{
            //TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_5);
        //}
        //else
        //{
        //    ;
        //}
    }
    else
    {
        //g_Light.Light_Auto = 0;
        //TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
    }
}
