#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 ++;
                if(g_FRStep < MenuCn)
                {
                  g_FRStep++;
                }
               
            }
            else
            {
                G_Button.LED_STEP = 0;
                g_FRStep = 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;
                g_FRStep = MenuCn;
            }
            else if((G_Button.LED_STEP > 0)&&(G_Button.LED_STEP <= MenuCn))
            {
                // G_Button.LED_STEP --;
                if((g_FRStep > 0) && (g_FRStep <= MenuCn))
                {
                  g_FRStep--;
                }
                
            }
            
            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;
    }
    
    
}


