#define  GLOBALS_GUI_DISP
#include "../app_Headers/g_includes.h"

/*-------------------------------------------------------------------------
* Function Name  : gui_LCD_Display
* Description    : LCD显示
* Input          : None
* Output         : None
* Return         : None
* onther         : 
--------------------------------------------------------------------------*/
void gui_LCD_Display(void) 
{  

   //百位
    m_LCDFP17BP = Matrix1[G_Button.LED_STEP / 10]>>4;
    m_LCDFP18BP = Matrix1[G_Button.LED_STEP / 10];
    
   //十位
    m_LCDFP19BP = Matrix1[G_Button.LED_STEP %10]>>4;
    m_LCDFP20BP = Matrix1[G_Button.LED_STEP %10];
    

    
    if(G_Button.LED_STEP == 13)
    { 
      m_LCDFP18BP &= ~0x08;
      m_LCDFP20BP &= ~0x08;
      m_LCDFP22BP &= ~0x08;      
      //D
      m_LCDFP7BP |= 0x0d;
      m_LCDFP8BP |= 0x07;    
    }
    if(G_Button.LED_STEP == 14)
    { 
      //L
      m_LCDFP18BP |= 0x08;
      m_LCDFP20BP |= 0x08;
      m_LCDFP22BP |= 0x08;
      //
      m_LCDFP7BP &= ~0x0d;
      m_LCDFP8BP &= ~0x07;           
    }
         
    if((G_Button.LED_STEP != 13) && (G_Button.LED_STEP != 14))
    {
      //
      m_LCDFP7BP &= ~0x0d;
      m_LCDFP8BP &= ~0x07;
      //
      m_LCDFP18BP &= ~0x08;
      m_LCDFP20BP &= ~0x08;
      m_LCDFP22BP &= ~0x08;      
    }           
    
    LCDRAM2_FP4BP = m_LCDFP4BP;
    LCDRAM2_FP5BP = m_LCDFP5BP;
    LCDRAM3_FP6BP = m_LCDFP6BP;
    LCDRAM3_FP7BP = m_LCDFP7BP;
    LCDRAM4_FP8BP = m_LCDFP8BP;   
    LCDRAM4_FP9BP = m_LCDFP9BP;            
    LCDRAM5_FP10BP = m_LCDFP10BP;
    LCDRAM5_FP11BP = m_LCDFP11BP;
    LCDRAM6_FP12BP = m_LCDFP12BP;
    LCDRAM6_FP13BP = m_LCDFP13BP;
    LCDRAM7_FP14BP = m_LCDFP14BP;
    LCDRAM7_FP15BP = m_LCDFP15BP;
    LCDRAM8_FP16BP = m_LCDFP16BP;
    LCDRAM8_FP17BP = m_LCDFP17BP;
    LCDRAM9_FP18BP = m_LCDFP18BP;
    LCDRAM9_FP19BP = m_LCDFP19BP;
    LCDRAM10_FP20BP = m_LCDFP20BP;
    LCDRAM10_FP21BP = m_LCDFP21BP;
    LCDRAM11_FP22BP = m_LCDFP22BP;
}
/*-------------------------------------------------------------------------
* Function Name  : Gui_KeyProc
* Description    :
* Input          : None
* Output         : None
* Return         : None
* onther         :
--------------------------------------------------------------------------*/
void Gui_ButtonProc(_Button* KeyMenu)
{
    /**lamp+**/
    //D 短按
    if(KeyAddIn == HIGH)
    {
        if((KeyMenu->PushTime1 >= T_100ms) && (KeyMenu->PushTime1 < T_2s))
        {
             XUN_HUAN=0;
            if((G_Button.LED_STEP >= 0)&&(G_Button.LED_STEP < MenuCn))
            {
                G_Button.LED_STEP ++;
               
            }
            else
            {
                G_Button.LED_STEP = 0;
            }
            
            KeyMenu->PushTime1 = null;
        }
    }
    //抬起
    if(KeyAddIn == HIGH)
    {
        KeyMenu->PushTime1 = null;
    }
    
    /**lamp-**/
    //D 短按
    if(KeySubIn == HIGH)
    {
        if((KeyMenu->PushTime2 >= T_100ms) && (KeyMenu->PushTime2 < T_2s))
        {
            XUN_HUAN=0;
            if(G_Button.LED_STEP == 0)
            {
                G_Button.LED_STEP = MenuCn;
            }
            else if((G_Button.LED_STEP > 0)&&(G_Button.LED_STEP <= MenuCn))
            {
                G_Button.LED_STEP --;
                
            }
            
            KeyMenu->PushTime2 = null;
        }
    }
    //抬起
    if(KeySubIn == HIGH)
    {
        KeyMenu->PushTime2 = null;
    } 
    
    /***/
    if((KeyAddIn == LOW) && (KeyMenu->PushTime1 >= T_1s) && (KeySubIn == LOW) && (KeyMenu->PushTime2 >= T_1s))
    {
        XUN_HUAN=1;
    }
    
    
}


