Wakeup Light with touch user interface, anti-aliased Font, SD card access and RTC usage on STM32F746NG-DISCO board

Dependencies:   BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src

UI_ColorTest.cpp

Committer:
the_sz
Date:
2015-11-09
Revision:
5:13c70bcde7f6
Child:
7:dc29f6647486

File content as of revision 5:13c70bcde7f6:

#include "WakeupLight.h"

int32_t                 color;

void UI_ColorTestHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui)
{
    switch (reason)
    {
        case UR_CLICK:
            DPrintf_("UI_ColorTestHandler: %u.\r\n",index);
            if (index==-1)
            {
                UI_Show(&uiMain);
                uiColorTest.data.valueAdjust.values[0]=0;
                uiColorTest.data.valueAdjust.values[1]=0;
                uiColorTest.data.valueAdjust.values[2]=0;
                uiColorTest.data.valueAdjust.values[3]=0;
            }
            else if (index==0)
                uiColorTest.data.valueAdjust.values[0]=(uiColorTest.data.valueAdjust.values[0]+0x10) & 0xFF;
            else if (index==1)
                uiColorTest.data.valueAdjust.values[1]=(uiColorTest.data.valueAdjust.values[1]+0x10) & 0xFF;
            else if (index==2)
                uiColorTest.data.valueAdjust.values[2]=(uiColorTest.data.valueAdjust.values[2]+0x10) & 0xFF;
            else if (index==3)
                uiColorTest.data.valueAdjust.values[3]=(uiColorTest.data.valueAdjust.values[3]+0x10) & 0xFF;
            else if (index==4)
                uiColorTest.data.valueAdjust.values[0]=(uiColorTest.data.valueAdjust.values[0]-0x10) & 0xFF;
            else if (index==5)
                uiColorTest.data.valueAdjust.values[1]=(uiColorTest.data.valueAdjust.values[1]-0x10) & 0xFF;
            else if (index==6)
                uiColorTest.data.valueAdjust.values[2]=(uiColorTest.data.valueAdjust.values[2]-0x10) & 0xFF;
            else if (index==7)
                uiColorTest.data.valueAdjust.values[3]=(uiColorTest.data.valueAdjust.values[3]-0x10) & 0xFF;
            // fall through

        case UR_SHOW:
            color=COLOR_CREATE(uiColorTest.data.valueAdjust.values[0],uiColorTest.data.valueAdjust.values[1],uiColorTest.data.valueAdjust.values[2],uiColorTest.data.valueAdjust.values[3]);
            DPrintf_("UI_ColorTestHandler: Color: 0x%08X.\r\n",color);
            LED_SetColor(color);
            break;
    }
}