Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src
Diff: UI_ColorTest.cpp
- Revision:
- 5:13c70bcde7f6
- Child:
- 7:dc29f6647486
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/UI_ColorTest.cpp Mon Nov 09 17:53:22 2015 +0000
@@ -0,0 +1,43 @@
+#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;
+ }
+}