GUIDEMO.c 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186
  1. /*********************************************************************
  2. * SEGGER Microcontroller GmbH & Co. KG *
  3. * Solutions for real time microcontroller applications *
  4. **********************************************************************
  5. * *
  6. * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
  7. * *
  8. * Internet: www.segger.com Support: support@segger.com *
  9. * *
  10. **********************************************************************
  11. ** emWin V5.32 - Graphical user interface for embedded applications **
  12. All Intellectual Property rights in the Software belongs to SEGGER.
  13. emWin is protected by international copyright laws. Knowledge of the
  14. source code may not be used to write a similar product. This file may
  15. only be used in accordance with the following terms:
  16. The software has been licensed to STMicroelectronics International
  17. N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
  18. les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
  19. purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
  20. troller products commercialized by Licensee only, sublicensed and dis_
  21. tributed under the terms and conditions of the End User License Agree_
  22. ment supplied by STMicroelectronics International N.V.
  23. Full source code is available at: www.segger.com
  24. We appreciate your understanding and fairness.
  25. ----------------------------------------------------------------------
  26. Licensing information
  27. Licensor: SEGGER Software GmbH
  28. Licensed to: STMicroelectronics International NV
  29. Licensed SEGGER software: emWin
  30. License number: GUI-00429
  31. License model: Buyout SRC [Buyout Source Code License, signed November 29th 2012]
  32. Licensed product: -
  33. Licensed platform: STMs ARM Cortex-M based 32 BIT CPUs
  34. Licensed number of seats: -
  35. ----------------------------------------------------------------------
  36. File : GUIDEMO.c
  37. Purpose : Several GUIDEMO routines
  38. ----------------------------------------------------------------------
  39. */
  40. #include "GUIDEMO.h"
  41. //
  42. // Recommended memory to run the sample with adequate performance
  43. //
  44. //#define RECOMMENDED_MEMORY (1024L * 2200)
  45. /*********************************************************************
  46. *
  47. * Dialog resources
  48. *
  49. **********************************************************************
  50. */
  51. #if GUI_WINSUPPORT
  52. static const GUI_WIDGET_CREATE_INFO _aFrameWinControl[] = {
  53. { FRAMEWIN_CreateIndirect, "Control", 0, 0, 0, CONTROL_SIZE_X, CONTROL_SIZE_Y, 0, 0 },
  54. { BUTTON_CreateIndirect, "Halt", GUI_ID_HALT, 3, 20, BUTTON_SIZE_X, BUTTON_SIZE_Y, 0, 0 },
  55. { BUTTON_CreateIndirect, "Next", GUI_ID_NEXT, 41, 20, BUTTON_SIZE_X, BUTTON_SIZE_Y, 0, 0 },
  56. { PROGBAR_CreateIndirect, 0, GUI_ID_PROGBAR0, 3, 4, PROGBAR_SIZE_X, PROGBAR_SIZE_Y, WM_CF_HIDE, 0 },
  57. { TEXT_CreateIndirect, 0, GUI_ID_TEXT0, 2, 2, TEXT_SIZE_X, TEXT_SIZE_Y, 0, 0 }
  58. };
  59. static const GUI_WIDGET_CREATE_INFO _aFrameWinInfo[] = {
  60. { FRAMEWIN_CreateIndirect, "STemWin Demo", 0, 0, 0, 0, 0, 0, 0 },
  61. { TEXT_CreateIndirect, "", GUI_ID_TEXT1, 5, 3, 0, 0, 0, 0 }
  62. };
  63. #endif
  64. /*********************************************************************
  65. *
  66. * Static variables
  67. *
  68. **********************************************************************
  69. */
  70. static GUIDEMO_CONFIG _GUIDemoConfig;
  71. #if GUI_WINSUPPORT
  72. static WM_HWIN _hDialogControl;
  73. static WM_HWIN _hDialogInfo;
  74. static int _iDemoMinor;
  75. #endif
  76. #if GUI_SUPPORT_MEMDEV
  77. static int _Pressed;
  78. #endif
  79. static void (* _pfDrawBk)(void);
  80. static int _iDemo;
  81. static int _HaltTime;
  82. static int _HaltTimeStart;
  83. static int _Halt;
  84. static int _Next;
  85. /*********************************************************************
  86. *
  87. * Static functions
  88. *
  89. **********************************************************************
  90. */
  91. /*********************************************************************
  92. *
  93. * _cbBk
  94. */
  95. #if GUI_WINSUPPORT
  96. static void _cbBk(WM_MESSAGE * pMsg) {
  97. WM_KEY_INFO * pInfo;
  98. switch (pMsg->MsgId) {
  99. case WM_PAINT:
  100. _pfDrawBk();
  101. break;
  102. case WM_SET_FOCUS:
  103. pMsg->Data.v = 0;
  104. break;
  105. case WM_KEY:
  106. pInfo = (WM_KEY_INFO *)pMsg->Data.p;
  107. if (pInfo->PressedCnt) {
  108. switch (pInfo->Key) {
  109. case 'n':
  110. _Next = 1;
  111. break;
  112. }
  113. }
  114. break;
  115. default:
  116. WM_DefaultProc(pMsg);
  117. break;
  118. }
  119. }
  120. #endif
  121. /*********************************************************************
  122. *
  123. * _cbEffect
  124. */
  125. #if GUI_SUPPORT_MEMDEV
  126. static int _cbEffect(int TimeRem, void * pVoid) {
  127. GUI_PID_STATE State;
  128. int Pressed;
  129. GUI_USE_PARA(TimeRem);
  130. GUI_Exec();
  131. GUI_PID_GetState(&State);
  132. if (State.Pressed) {
  133. *((int *)pVoid) = 1;
  134. return 0;
  135. } else {
  136. Pressed = *((int *)pVoid);
  137. if ((State.Pressed == 0) && (Pressed == 1)) {
  138. *((int *)pVoid) = 0;
  139. _Next = 1;
  140. return 1;
  141. }
  142. _Next = GUIDEMO_CheckCancel();
  143. return _Next;
  144. }
  145. }
  146. #endif
  147. /*********************************************************************
  148. *
  149. * _DrawWindowBk
  150. */
  151. static void _DrawWindowBk(WM_HWIN hWin) {
  152. int xSize, ySize;
  153. xSize = WM_GetWindowSizeX(hWin);
  154. ySize = WM_GetWindowSizeY(hWin);
  155. GUI_DrawGradientV(1, 0, xSize - 2, ySize - 1, GUI_MAKE_COLOR(0xF3F3E6), GUI_MAKE_COLOR(0xDCCEC0));
  156. GUI_SetColor(GUI_MAKE_COLOR(0xA8A851));
  157. GUI_DrawRect(0, -1, xSize - 1, ySize - 1);
  158. }
  159. /*********************************************************************
  160. *
  161. * _cbFrameWinControl
  162. */
  163. #if GUI_WINSUPPORT
  164. static void _cbFrameWinControl(WM_MESSAGE * pMsg) {
  165. WM_HWIN hItem;
  166. int NCode;
  167. int Id;
  168. switch (pMsg->MsgId) {
  169. case WM_KEY:
  170. WM_SendMessage(WM_HBKWIN, pMsg);
  171. break;
  172. case WM_INIT_DIALOG:
  173. FRAMEWIN_SetFont(pMsg->hWin, &GUI_Font8_1);
  174. FRAMEWIN_SetTitleHeight(pMsg->hWin, 14);
  175. hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_PROGBAR0);
  176. PROGBAR_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  177. PROGBAR_SetFont(hItem, &GUI_FontD6x8);
  178. hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_HALT);
  179. BUTTON_SetFocussable(hItem, 0);
  180. hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_NEXT);
  181. BUTTON_SetFocussable(hItem, 0);
  182. hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_TEXT0);
  183. TEXT_SetText(hItem, "Intro");
  184. TEXT_SetFont(hItem, &GUI_Font8_ASCII);
  185. break;
  186. case WM_PAINT:
  187. _DrawWindowBk(pMsg->hWin);
  188. break;
  189. case WM_NOTIFY_PARENT:
  190. Id = WM_GetId(pMsg->hWinSrc);
  191. NCode = pMsg->Data.v;
  192. switch (NCode) {
  193. case WM_NOTIFICATION_RELEASED:
  194. switch (Id) {
  195. case GUI_ID_HALT:
  196. if (_Halt) {
  197. _Halt = 0;
  198. _HaltTime = GUI_GetTime() - _HaltTimeStart;
  199. WM_MakeModal(0);
  200. } else {
  201. _Halt = 1;
  202. _HaltTimeStart = GUI_GetTime() - _HaltTime;
  203. WM_MakeModal(pMsg->hWin);
  204. }
  205. break;
  206. case GUI_ID_NEXT:
  207. _Next = 1; // Will be set to 0 by GUIDEMO_GetNextState()
  208. GUIDEMO_ClearHalt(); // Clear _Halt, so the next sample demonstrates immediately
  209. break;
  210. }
  211. break;
  212. }
  213. break;
  214. default:
  215. WM_DefaultProc(pMsg);
  216. }
  217. }
  218. #endif
  219. /*********************************************************************
  220. *
  221. * _cbFrameWinInfo
  222. */
  223. #if GUI_WINSUPPORT
  224. static void _cbFrameWinInfo(WM_MESSAGE * pMsg) {
  225. WM_HWIN hItem;
  226. int xSize;
  227. switch (pMsg->MsgId) {
  228. case WM_INIT_DIALOG:
  229. hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_TEXT1);
  230. TEXT_SetWrapMode(hItem, GUI_WRAPMODE_WORD);
  231. TEXT_SetTextColor(hItem, GUI_MAKE_COLOR(0x545428));
  232. break;
  233. case WM_KEY:
  234. WM_SendMessage(WM_HBKWIN, pMsg);
  235. break;
  236. case WM_CREATE:
  237. xSize = LCD_GetXSize();
  238. WM_SetWindowPos(pMsg->hWin, xSize / 2, 0, xSize / 2, INFO_SIZE_Y);
  239. break;
  240. case WM_PAINT:
  241. _DrawWindowBk(pMsg->hWin);
  242. break;
  243. default:
  244. WM_DefaultProc(pMsg);
  245. }
  246. }
  247. #endif
  248. /*********************************************************************
  249. *
  250. * _DrawBk
  251. */
  252. #if GUIDEMO_USE_AUTO_BK
  253. static void _DrawBk(void) {
  254. int xSize;
  255. int ySize;
  256. xSize = LCD_GetXSize();
  257. ySize = LCD_GetYSize();
  258. GUI_DrawGradientV(0, 0, xSize, ySize, BK_COLOR_0, BK_COLOR_1);
  259. GUI_DrawBitmap(&bmSTLogo70x35, LOGO_DIST_BORDER, LOGO_DIST_BORDER);
  260. }
  261. #endif
  262. /*********************************************************************
  263. *
  264. * _DrawBkCircle
  265. */
  266. #if (GUIDEMO_USE_AUTO_BK && GUI_SUPPORT_MEMDEV)
  267. static void _DrawBkCircle(void) {
  268. static GUI_MEMDEV_Handle hMemStretch;
  269. GUI_MEMDEV_Handle hMemGradient;
  270. GUI_MEMDEV_Handle hMemCircle;
  271. GUI_MEMDEV_Handle hMemOld;
  272. int CircleWidth;
  273. int xSize;
  274. int ySize;
  275. int i;
  276. U32 * pData;
  277. xSize = LCD_GetXSize();
  278. ySize = LCD_GetYSize();
  279. if (hMemStretch == 0) {
  280. CircleWidth = (CIRCLE_RADIUS << 1) + 1;
  281. hMemCircle = GUI_MEMDEV_CreateFixed32(0, 0, CircleWidth, CircleWidth);
  282. hMemStretch = GUI_MEMDEV_CreateEx (0, 0, xSize, ySize, GUI_MEMDEV_NOTRANS);
  283. hMemGradient = GUI_MEMDEV_CreateFixed32(0, 0, 1, CIRCLE_RADIUS);
  284. //
  285. // Initialize background
  286. //
  287. hMemOld = GUI_MEMDEV_Select(hMemCircle);
  288. GUI_SetBkColor(BK_COLOR_1);
  289. GUI_Clear();
  290. //
  291. // Create Gradient
  292. //
  293. GUI_MEMDEV_Select(hMemGradient);
  294. GUI_DrawGradientV(0, 0, 0, CIRCLE_RADIUS, BK_COLOR_0, BK_COLOR_1);
  295. //
  296. // Get color and draw circles
  297. //
  298. pData = (U32 *)GUI_MEMDEV_GetDataPtr(hMemGradient);
  299. GUI_MEMDEV_Select(hMemCircle);
  300. for (i = 0; i < CIRCLE_RADIUS; i++, pData++) {
  301. GUI_SetColor(*pData);
  302. GUI_DrawCircle(CIRCLE_RADIUS, CIRCLE_RADIUS, i);
  303. }
  304. //
  305. // Stretch and display
  306. //
  307. GUI_MEMDEV_Select(hMemStretch);
  308. GUI_MEMDEV_DrawPerspectiveX(hMemCircle, 0, 0, ySize, ySize, xSize, 0);
  309. //
  310. // Putting logo into memory device avoids flickering effect
  311. //
  312. GUI_DrawBitmap(&bmSTLogo70x35, LOGO_DIST_BORDER, LOGO_DIST_BORDER);
  313. //
  314. // Delete helper devices
  315. //
  316. GUI_MEMDEV_Delete(hMemCircle);
  317. GUI_MEMDEV_Delete(hMemGradient);
  318. GUI_MEMDEV_Select(hMemOld);
  319. }
  320. GUI_MEMDEV_Write(hMemStretch);
  321. }
  322. #endif
  323. /*********************************************************************
  324. *
  325. * _DrawBkSimple
  326. */
  327. static void _DrawBkSimple(void) {
  328. GUI_SetBkColor(BK_COLOR_1);
  329. GUI_Clear();
  330. GUI_DrawBitmap(&bmSTLogo70x35, LOGO_DIST_BORDER, LOGO_DIST_BORDER);
  331. }
  332. /*********************************************************************
  333. *
  334. * _FrameDrawSkinFlex
  335. */
  336. #if GUI_WINSUPPORT
  337. static int _FrameDrawSkinFlex(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo) {
  338. switch (pDrawItemInfo->Cmd) {
  339. case WIDGET_ITEM_CREATE:
  340. FRAMEWIN_SetTextAlign(pDrawItemInfo->hWin, GUI_TA_HCENTER | GUI_TA_VCENTER);
  341. FRAMEWIN_SetTextColor(pDrawItemInfo->hWin, GUI_BLACK);
  342. break;
  343. default:
  344. return FRAMEWIN_DrawSkinFlex(pDrawItemInfo);
  345. }
  346. return 0;
  347. }
  348. #endif
  349. /*********************************************************************
  350. *
  351. * _HideProgress
  352. */
  353. #if GUI_WINSUPPORT
  354. static void _HideProgress(void) {
  355. PROGBAR_Handle hProg;
  356. hProg = WM_GetDialogItem(_hDialogControl, GUI_ID_PROGBAR0);
  357. WM_HideWindow(hProg);
  358. }
  359. #endif
  360. /*********************************************************************
  361. *
  362. * _IntroduceDemo
  363. *
  364. * Function description
  365. * Shows the GUIDEMO introduction screen which display the title of
  366. * the sample and a short description.
  367. */
  368. static void _IntroduceDemo(const char * pTitle, const char * pDescription) {
  369. int FontDistY;
  370. int TimeWait;
  371. int xCenter;
  372. int yCenter;
  373. int xSize;
  374. int ySize;
  375. int i;
  376. xSize = LCD_GetXSize();
  377. ySize = LCD_GetYSize();
  378. xCenter = xSize / 2;
  379. yCenter = ySize / 2;
  380. #if GUIDEMO_SUPPORT_CURSOR
  381. GUIDEMO_ShowCursor();
  382. #endif
  383. #if GUI_WINSUPPORT
  384. WM_HideWindow(_hDialogInfo);
  385. WM_ShowWindow(_hDialogControl);
  386. #endif
  387. GUI_Exec();
  388. GUIDEMO_DrawBk();
  389. GUI_SetColor(GUI_WHITE);
  390. //
  391. // Title
  392. //
  393. GUI_SetTextMode(GUI_TM_TRANS);
  394. GUI_SetFont(&GUI_FontRounded22);
  395. GUI_DispStringHCenterAt(pTitle, xCenter, 60);
  396. //
  397. // Description
  398. //
  399. GUI_SetFont(&GUI_FontSouvenir18);
  400. FontDistY = GUI_GetFontDistY();
  401. GUI_DispStringHCenterAt(pDescription, xCenter, yCenter - FontDistY + 10);
  402. //
  403. // Determine time to wait
  404. //
  405. i = 0;
  406. while (pDescription[i]) {
  407. i++;
  408. }
  409. TimeWait = i * CHAR_READING_TIME;
  410. GUIDEMO_Wait(TimeWait);
  411. }
  412. /*********************************************************************
  413. *
  414. * _UpdateControlText
  415. */
  416. #if GUI_WINSUPPORT
  417. static void _UpdateControlText(void) {
  418. TEXT_Handle hText;
  419. char acText[20] = { 0 };
  420. hText = WM_GetDialogItem(_hDialogControl, GUI_ID_TEXT0);
  421. GUIDEMO_AddStringToString(acText, "Demo ");
  422. GUIDEMO_AddIntToString (acText, _iDemo + 1);
  423. GUIDEMO_AddStringToString(acText, ".");
  424. GUIDEMO_AddIntToString (acText, _iDemoMinor);
  425. GUIDEMO_AddStringToString(acText, "/");
  426. GUIDEMO_AddIntToString (acText, _GUIDemoConfig.NumDemos - 1);
  427. TEXT_SetText (hText, acText);
  428. }
  429. #endif
  430. /*********************************************************************
  431. *
  432. * _DrawSkin_BUTTON
  433. */
  434. static int _DrawSkin_BUTTON(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo) {
  435. const GUI_BITMAP * pBm;
  436. switch (pDrawItemInfo->Cmd) {
  437. case WIDGET_ITEM_DRAW_TEXT:
  438. GUI_SetColor(GUI_BLACK);
  439. switch(WM_GetId(pDrawItemInfo->hWin)) {
  440. case GUI_ID_HALT:
  441. if (BUTTON_IsPressed(pDrawItemInfo->hWin)) {
  442. GUI_SetColor(GUI_MAKE_COLOR(0xFFFFFF));
  443. } else {
  444. GUI_SetColor(GUI_MAKE_COLOR(0xA8A851));
  445. }
  446. if (_Halt) {
  447. pBm = &bmplay;
  448. } else {
  449. pBm = &bmstop;
  450. }
  451. GUI_DrawBitmap(pBm, ((pDrawItemInfo->x1 - pDrawItemInfo->x0) - pBm->XSize) / 2 + 1, ((pDrawItemInfo->y1 - pDrawItemInfo->y0) - pBm->YSize) / 2 + 1);
  452. break;
  453. case GUI_ID_NEXT:
  454. if (BUTTON_IsPressed(pDrawItemInfo->hWin)) {
  455. GUI_SetColor(GUI_MAKE_COLOR(0xFFFFFF));
  456. } else {
  457. GUI_SetColor(GUI_MAKE_COLOR(0xA8A851));
  458. }
  459. GUI_DrawBitmap(&bmforward, ((pDrawItemInfo->x1 - pDrawItemInfo->x0) - bmforward.XSize) / 2 + 1, ((pDrawItemInfo->y1 - pDrawItemInfo->y0) - bmforward.YSize) / 2 + 1);
  460. break;
  461. }
  462. break;
  463. case WIDGET_ITEM_DRAW_BACKGROUND:
  464. #if 0
  465. //
  466. // Windows8 style flat buttons
  467. //
  468. GUI_SetColor(GUI_MAKE_COLOR(0xA8A851));
  469. GUI_AA_DisableHiRes();
  470. if (BUTTON_IsPressed(pDrawItemInfo->hWin)) {
  471. GUI_AA_FillRoundedRect(pDrawItemInfo->x0 + 1, pDrawItemInfo->y0 + 1, pDrawItemInfo->x0 + BUTTON_SIZE_X - 2, pDrawItemInfo->y0 + BUTTON_SIZE_Y - 2, 4);
  472. } else {
  473. GUI_AA_DrawRoundedRect(pDrawItemInfo->x0 + 1, pDrawItemInfo->y0 + 1, pDrawItemInfo->x0 + BUTTON_SIZE_X - 2, pDrawItemInfo->y0 + BUTTON_SIZE_Y - 2, 4);
  474. }
  475. #else
  476. //
  477. // Glassy buttons
  478. //
  479. if (BUTTON_IsPressed(pDrawItemInfo->hWin)) {
  480. GUI_DrawBitmap(&bmbutton_1, pDrawItemInfo->x0, pDrawItemInfo->y0);
  481. } else {
  482. GUI_DrawBitmap(&bmbutton_0, pDrawItemInfo->x0, pDrawItemInfo->y0);
  483. }
  484. #endif
  485. break;
  486. default:
  487. //
  488. // Use the default skinning routine for processing all other commands
  489. //
  490. return BUTTON_DrawSkinFlex(pDrawItemInfo);
  491. }
  492. return 0;
  493. }
  494. /*********************************************************************
  495. *
  496. * _DrawSkin_PROGBAR
  497. */
  498. static int _DrawSkin_PROGBAR(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo) {
  499. int v, i, Min, Max, Pos;
  500. switch (pDrawItemInfo->Cmd) {
  501. case WIDGET_ITEM_DRAW_FRAME:
  502. GUI_SetColor(GUI_MAKE_COLOR(0xA8A851));
  503. GUI_DrawRect(pDrawItemInfo->x0, pDrawItemInfo->y0, pDrawItemInfo->x1, pDrawItemInfo->y1);
  504. break;
  505. case WIDGET_ITEM_DRAW_BACKGROUND:
  506. v = PROGBAR_GetValue(pDrawItemInfo->hWin);
  507. PROGBAR_GetMinMax(pDrawItemInfo->hWin, &Min, &Max);
  508. Pos = ((v * bmgrad_32x16.XSize * 4) / (Max - Min + 1)) % bmgrad_32x16.XSize;
  509. for (i = -1; i < 3; i++) {
  510. GUI_DrawBitmap(&bmgrad_32x16, bmgrad_32x16.XSize * i + Pos + 1, 1);
  511. }
  512. break;
  513. case WIDGET_ITEM_DRAW_TEXT:
  514. //
  515. // Do not show any text...
  516. //
  517. break;
  518. default:
  519. //
  520. // Use the default skinning routine for processing all other commands
  521. //
  522. return PROGBAR_DrawSkinFlex(pDrawItemInfo);
  523. }
  524. return 0;
  525. }
  526. /*********************************************************************
  527. *
  528. * _DrawSkin_FRAMEWIN
  529. */
  530. static int _DrawSkin_FRAMEWIN(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo) {
  531. GUI_RECT Rect;
  532. char acBuffer[20];
  533. switch (pDrawItemInfo->Cmd) {
  534. case WIDGET_ITEM_GET_BORDERSIZE_B:
  535. case WIDGET_ITEM_GET_BORDERSIZE_L:
  536. case WIDGET_ITEM_GET_BORDERSIZE_R:
  537. case WIDGET_ITEM_GET_BORDERSIZE_T:
  538. return 0;
  539. case WIDGET_ITEM_DRAW_BACKGROUND:
  540. GUI_SetBkColor(GUI_MAKE_COLOR(0xA8A851));
  541. GUI_Clear();
  542. break;
  543. case WIDGET_ITEM_DRAW_TEXT:
  544. Rect.x0 = pDrawItemInfo->x0;
  545. Rect.x1 = pDrawItemInfo->x1;
  546. Rect.y0 = pDrawItemInfo->y0;
  547. Rect.y1 = pDrawItemInfo->y1;
  548. GUI_SetColor(GUI_WHITE);
  549. GUI_SetFont(GUI_FONT_13_ASCII);
  550. GUI_SetTextMode(GUI_TM_TRANS);
  551. FRAMEWIN_GetText(pDrawItemInfo->hWin, acBuffer, sizeof(acBuffer));
  552. GUI_DispStringInRect(acBuffer, &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
  553. break;
  554. case WIDGET_ITEM_DRAW_SEP:
  555. GUI_SetColor(GUI_MAKE_COLOR(0xC0C0C0));
  556. GUI_FillRect(pDrawItemInfo->x0, pDrawItemInfo->y0, pDrawItemInfo->x1,pDrawItemInfo->y1);
  557. break;
  558. default:
  559. //
  560. // Use the default skinning routine for processing all other commands
  561. //
  562. return _FrameDrawSkinFlex(pDrawItemInfo);
  563. }
  564. return 0;
  565. }
  566. /*********************************************************************
  567. *
  568. * _Main
  569. */
  570. static void _Main(void) {
  571. #if GUI_WINSUPPORT
  572. int xSize;
  573. int ySize;
  574. WM_HWIN hItem;
  575. WM_SelectWindow(WM_HBKWIN);
  576. #endif
  577. GUI_Clear();
  578. #if GUIDEMO_SUPPORT_CURSOR
  579. GUIDEMO_ShowCursor();
  580. #endif
  581. //
  582. // Create and configure Control and Information window
  583. //
  584. #if GUI_WINSUPPORT
  585. xSize = LCD_GetXSize();
  586. ySize = LCD_GetYSize();
  587. //
  588. // Set skinning functions for control- and info window
  589. //
  590. FRAMEWIN_SetDefaultSkin(_DrawSkin_FRAMEWIN);
  591. BUTTON_SetDefaultSkin(_DrawSkin_BUTTON);
  592. PROGBAR_SetDefaultSkin(_DrawSkin_PROGBAR);
  593. //
  594. // Create control- and info window
  595. //
  596. _hDialogControl = GUI_CreateDialogBox(_aFrameWinControl, GUI_COUNTOF(_aFrameWinControl), _cbFrameWinControl, WM_HBKWIN, xSize - CONTROL_SIZE_X, ySize - CONTROL_SIZE_Y);
  597. _hDialogInfo = GUI_CreateDialogBox(_aFrameWinInfo, GUI_COUNTOF(_aFrameWinInfo), _cbFrameWinInfo, WM_HBKWIN, xSize / 2 - 1, 0 );
  598. WM_HideWindow(_hDialogInfo);
  599. //
  600. // Reset skinning functions to (demo)defaults
  601. //
  602. FRAMEWIN_SetDefaultSkin(_FrameDrawSkinFlex);
  603. BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
  604. PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
  605. //
  606. // Hide ugly text, may be (re)activated in a later version
  607. //
  608. hItem = WM_GetDialogItem(_hDialogControl, GUI_ID_TEXT0);
  609. WM_HideWindow(hItem);
  610. //
  611. // Show Intro
  612. //
  613. WM_InvalidateWindow(WM_HBKWIN);
  614. GUI_Exec();
  615. #endif
  616. GUIDEMO_Intro();
  617. //
  618. // Run the demos
  619. //
  620. for (_iDemo = 0; _GUIDemoConfig.apFunc[_iDemo]; _iDemo++) {
  621. GUIDEMO_ClearHalt();
  622. #if GUI_WINSUPPORT
  623. _UpdateControlText();
  624. #endif
  625. (*_GUIDemoConfig.apFunc[_iDemo])();
  626. #if GUI_WINSUPPORT
  627. _iDemoMinor = 0;
  628. #endif
  629. #if GUI_SUPPORT_MEMDEV
  630. _Pressed = 0;
  631. #endif
  632. }
  633. _iDemo = 0;
  634. //
  635. // Cleanup
  636. //
  637. #if GUI_WINSUPPORT
  638. WM_DeleteWindow(_hDialogControl);
  639. WM_DeleteWindow(_hDialogInfo);
  640. #endif
  641. }
  642. /*********************************************************************
  643. *
  644. * _ShowProgress
  645. */
  646. #if GUI_WINSUPPORT
  647. static void _ShowProgress(void) {
  648. PROGBAR_Handle hProg;
  649. hProg = WM_GetDialogItem(_hDialogControl, GUI_ID_PROGBAR0);
  650. WM_ShowWindow(hProg);
  651. }
  652. #endif
  653. /*********************************************************************
  654. *
  655. * Public functions (Cursor only)
  656. *
  657. **********************************************************************
  658. */
  659. /*********************************************************************
  660. *
  661. * GUIDEMO_HideCursor
  662. *
  663. * Function description
  664. * Hides the cursor according to the preprocessor settings and config flags.
  665. */
  666. #if GUIDEMO_SUPPORT_CURSOR
  667. void GUIDEMO_HideCursor(void) {
  668. if (GUIDEMO_GetConfFlag(GUIDEMO_CF_SUPPORT_TOUCH)) {
  669. GUI_CURSOR_Hide();
  670. }
  671. }
  672. #endif
  673. /*********************************************************************
  674. *
  675. * GUIDEMO_ShowCursor
  676. *
  677. * Function description
  678. * Shows the cursor according to the preprocessor settings and config flags.
  679. */
  680. #if GUIDEMO_SUPPORT_CURSOR
  681. void GUIDEMO_ShowCursor(void) {
  682. if (GUIDEMO_GetConfFlag(GUIDEMO_CF_SUPPORT_TOUCH)) {
  683. GUI_CURSOR_Show();
  684. }
  685. }
  686. #endif
  687. /*********************************************************************
  688. *
  689. * Public functions (WM only)
  690. *
  691. **********************************************************************
  692. */
  693. /*********************************************************************
  694. *
  695. * GUIDEMO_Delay
  696. *
  697. * Function description
  698. * This function has to be called if the current step of the sample
  699. * is the last one and consists of a single frame.
  700. */
  701. #if GUI_WINSUPPORT
  702. void GUIDEMO_Delay(int TimeDelay) {
  703. PROGBAR_Handle hProg;
  704. int NextState;
  705. U32 TimeStart;
  706. U32 TimeDiff;
  707. hProg = WM_GetDialogItem(_hDialogControl, GUI_ID_PROGBAR0);
  708. if (TimeDelay > SHOW_PROGBAR_AT) {
  709. _ShowProgress();
  710. }
  711. PROGBAR_SetValue(hProg, 0);
  712. PROGBAR_SetMinMax(hProg, 0, TimeDelay);
  713. TimeStart = GUI_GetTime();
  714. do {
  715. TimeDiff = GUIDEMO_GetTime() - TimeStart;
  716. if (TimeDelay > SHOW_PROGBAR_AT) {
  717. PROGBAR_SetValue(hProg, TimeDiff);
  718. WM_InvalidateWindow(hProg);
  719. }
  720. GUI_Delay(5);
  721. NextState = GUIDEMO_CheckCancel();
  722. } while (TimeDiff < (U32)TimeDelay && !NextState);
  723. if (TimeDelay > SHOW_PROGBAR_AT) {
  724. _HideProgress();
  725. }
  726. }
  727. #endif
  728. /*********************************************************************
  729. *
  730. * GUIDEMO_NotifyStartNext
  731. *
  732. * Use this function if the next step of the current sample will be
  733. * shown immediately
  734. */
  735. #if GUI_WINSUPPORT
  736. void GUIDEMO_NotifyStartNext(void) {
  737. _iDemoMinor++;
  738. GUIDEMO_ClearHalt();
  739. _UpdateControlText();
  740. }
  741. #endif
  742. /*********************************************************************
  743. *
  744. * GUIDEMO_SetInfoText
  745. */
  746. #if GUI_WINSUPPORT
  747. void GUIDEMO_SetInfoText(const char * pInfo) {
  748. TEXT_Handle hText;
  749. if (WM_IsVisible(_hDialogInfo)) {
  750. hText = WM_GetDialogItem(_hDialogInfo, GUI_ID_TEXT1);
  751. TEXT_SetText(hText, pInfo);
  752. }
  753. }
  754. #endif
  755. /*********************************************************************
  756. *
  757. * Public functions (general)
  758. *
  759. **********************************************************************
  760. */
  761. /*********************************************************************
  762. *
  763. * GUIDEMO_AddIntToString
  764. */
  765. void GUIDEMO_AddIntToString(char * pText, U32 Number) {
  766. int TextLen;
  767. int LenNum;
  768. U32 i;
  769. TextLen = 0;
  770. while (*(pText + TextLen)) {
  771. TextLen++;
  772. }
  773. i = 1;
  774. LenNum = 1;
  775. while ((Number / i) >= 10) {
  776. i *= 10;
  777. LenNum++;
  778. }
  779. *(pText + TextLen + LenNum) = '\0';
  780. while (LenNum) {
  781. *(pText + TextLen + LenNum - 1) = '0' + Number % 10;
  782. Number /= 10;
  783. LenNum--;
  784. }
  785. }
  786. /***************i******************************************************
  787. *
  788. * GUIDEMO_AddStringToString
  789. */
  790. void GUIDEMO_AddStringToString(char * pText, const char * pAdd) {
  791. int i;
  792. int j;
  793. i = 0;
  794. j = 0;
  795. while (*(pText + i)) {
  796. i++;
  797. }
  798. while (*(pAdd + j)) {
  799. *(pText + i) = *(pAdd + j);
  800. i++;
  801. j++;
  802. }
  803. *(pText + i) = '\0';
  804. }
  805. /*********************************************************************
  806. *
  807. * GUIDEMO_CheckCancel
  808. */
  809. int GUIDEMO_CheckCancel(void) {
  810. //
  811. // Do not return until the button is released
  812. //
  813. while (_Halt == 1) {
  814. GUI_Delay(10);
  815. }
  816. //
  817. // Check Next Button
  818. //
  819. if (_Next == 1) {
  820. _Next = 0;
  821. return 1;
  822. }
  823. return 0;
  824. }
  825. /*********************************************************************
  826. *
  827. * GUIDEMO_CheckCancelDelay
  828. *
  829. * Function description:
  830. * Checks for cancel input every 10 ms for the given amount of time.
  831. */
  832. int GUIDEMO_CheckCancelDelay(int Delay) {
  833. int TimeNow;
  834. int TimeEnd;
  835. TimeNow = GUI_GetTime();
  836. TimeEnd = TimeNow + Delay;
  837. do {
  838. GUI_Delay(10);
  839. TimeNow = GUI_GetTime();
  840. if (GUIDEMO_CheckCancel()) {
  841. GUIDEMO_NotifyStartNext();
  842. return 1;
  843. }
  844. } while (TimeNow < TimeEnd);
  845. return 0;
  846. }
  847. /*********************************************************************
  848. *
  849. * GUIDEMO_ClearHalt
  850. *
  851. * This function is called if the next button is pressed after
  852. * the demo was halted.
  853. */
  854. void GUIDEMO_ClearHalt(void) {
  855. _Halt = 0;
  856. _HaltTime = 0;
  857. _HaltTimeStart = 0;
  858. }
  859. /*********************************************************************
  860. *
  861. * GUIDEMO_ClearText
  862. *
  863. */
  864. void GUIDEMO_ClearText(char * pText) {
  865. *pText = 0;
  866. }
  867. /*********************************************************************
  868. *
  869. * GUIDEMO_ConfigureDemo
  870. *
  871. * Function description
  872. * Configure the GUIDEMO for the current sample. Show the introduction
  873. * And change the visibility of the cursor, info- and control-window.
  874. *
  875. * The following defines may be used as flags:
  876. * - GUIDEMO_SHOW_CURSOR
  877. * - GUIDEMO_SHOW_INFO
  878. * - GUIDEMO_SHOW_CONTROL
  879. *
  880. * If a flag is not set this means that the according feature is turned off.
  881. */
  882. void GUIDEMO_ConfigureDemo(char * pTitle, char * pDescription, unsigned Flags) {
  883. if (pTitle && pDescription) {
  884. _IntroduceDemo(pTitle, pDescription);
  885. }
  886. #if GUIDEMO_SUPPORT_CURSOR
  887. if (Flags & GUIDEMO_SHOW_CURSOR) {
  888. GUIDEMO_ShowCursor();
  889. } else {
  890. GUIDEMO_HideCursor();
  891. }
  892. #endif
  893. #if GUI_WINSUPPORT
  894. if (Flags & GUIDEMO_SHOW_INFO) {
  895. WM_ShowWindow(_hDialogInfo);
  896. } else {
  897. WM_HideWindow(_hDialogInfo);
  898. }
  899. if (Flags & GUIDEMO_SHOW_CONTROL) {
  900. WM_ShowWindow(_hDialogControl);
  901. } else {
  902. WM_HideWindow(_hDialogControl);
  903. }
  904. #endif
  905. }
  906. /*********************************************************************
  907. *
  908. * GUIDEMO_DispTitle
  909. */
  910. void GUIDEMO_DispTitle(char * pTitle) {
  911. GUI_RECT RectTitle;
  912. int StringLen;
  913. int xSize;
  914. GUI_SetFont(&GUI_FontRounded22);
  915. StringLen = GUI_GetStringDistX(pTitle);
  916. xSize = LCD_GetXSize();
  917. if ((xSize - StringLen) / 2 - 5 < bmSTLogo70x35.XSize + LOGO_DIST_BORDER) {
  918. RectTitle.x0 = bmSTLogo70x35.XSize + LOGO_DIST_BORDER;
  919. } else {
  920. RectTitle.x0 = 0;
  921. }
  922. RectTitle.y0 = 0;
  923. RectTitle.x1 = xSize - 1;
  924. RectTitle.y1 = bmSTLogo70x35.YSize + 2 * LOGO_DIST_BORDER - 1;
  925. GUI_SetTextMode(GUI_TM_TRANS);
  926. GUI_DispStringInRect(pTitle, &RectTitle, GUI_TA_HCENTER | GUI_TA_VCENTER);
  927. }
  928. /*********************************************************************
  929. *
  930. * GUIDEMO_DispHint
  931. */
  932. void GUIDEMO_DispHint(char * pHint) {
  933. GUI_RECT RectHint;
  934. int StringLen;
  935. int xSize;
  936. int ySize;
  937. GUI_SetFont(&GUI_FontRounded16);
  938. StringLen = GUI_GetStringDistX(pHint);
  939. xSize = LCD_GetXSize();
  940. ySize = LCD_GetYSize();
  941. if ((xSize - StringLen) / 2 - 5 < CONTROL_SIZE_X) {
  942. RectHint.x1 = xSize - 1 - CONTROL_SIZE_X;
  943. } else {
  944. RectHint.x1 = xSize - 1;
  945. }
  946. RectHint.x0 = 0;
  947. RectHint.y0 = ySize - 1 - CONTROL_SIZE_Y;
  948. RectHint.y1 = ySize - 1;
  949. GUI_SetTextMode(GUI_TM_TRANS);
  950. GUI_DispStringInRect(pHint, &RectHint, GUI_TA_HCENTER | GUI_TA_VCENTER);
  951. }
  952. /*********************************************************************
  953. *
  954. * GUIDEMO_DrawBk
  955. */
  956. void GUIDEMO_DrawBk(void) {
  957. _pfDrawBk();
  958. }
  959. /*********************************************************************
  960. *
  961. * GUIDEMO_GetConfFlag
  962. */
  963. U16 GUIDEMO_GetConfFlag(U16 Flag) {
  964. return (_GUIDemoConfig.Flags & Flag) ? 1 : 0;
  965. }
  966. /*********************************************************************
  967. *
  968. * GUIDEMO_GetTime
  969. */
  970. int GUIDEMO_GetTime(void) {
  971. return _Halt ? _HaltTimeStart : GUI_GetTime() - _HaltTime;
  972. }
  973. /*********************************************************************
  974. *
  975. * GUIDEMO_GetTitleSizeY
  976. */
  977. int GUIDEMO_GetTitleSizeY(void) {
  978. return bmSTLogo70x35.YSize + 2 * LOGO_DIST_BORDER;
  979. }
  980. /*********************************************************************
  981. *
  982. * GUIDEMO_Main
  983. */
  984. void GUIDEMO_Main(void) {
  985. #if GUI_WINSUPPORT
  986. FRAMEWIN_SKINFLEX_PROPS Framewin_Props;
  987. #endif
  988. #if GUIDEMO_USE_AUTO_BK
  989. U32 NumFreeBytes;
  990. int BitsPerPixel;
  991. #endif
  992. //
  993. // Check if recommended memory for the sample is available
  994. //
  995. // if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
  996. // GUI_ErrorOut("Not enough memory available.");
  997. // return;
  998. // }
  999. #if GUI_SUPPORT_MEMDEV
  1000. GUI_MEMDEV_SetAnimationCallback(_cbEffect, (void *)&_Pressed);
  1001. #endif
  1002. #if GUI_WINSUPPORT
  1003. WM_SetCallback(WM_HBKWIN, _cbBk);
  1004. BUTTON_SetReactOnLevel();
  1005. FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
  1006. Framewin_Props.Radius = 0;
  1007. FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
  1008. FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
  1009. Framewin_Props.Radius = 0;
  1010. FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
  1011. FRAMEWIN_SetDefaultSkin (_FrameDrawSkinFlex);
  1012. PROGBAR_SetDefaultSkin (PROGBAR_SKIN_FLEX);
  1013. BUTTON_SetDefaultSkin (BUTTON_SKIN_FLEX);
  1014. SCROLLBAR_SetDefaultSkin (SCROLLBAR_SKIN_FLEX);
  1015. SLIDER_SetDefaultSkin (SLIDER_SKIN_FLEX);
  1016. HEADER_SetDefaultSkin (HEADER_SKIN_FLEX);
  1017. #endif
  1018. GUI_SetTextMode(GUI_TM_TRANS);
  1019. GUIDEMO_Config(&_GUIDemoConfig);
  1020. #if GUIDEMO_USE_VNC
  1021. if (GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_VNC)) {
  1022. _GUIDemoConfig.pGUI_VNC_X_StartServer(0, 0);
  1023. }
  1024. #endif
  1025. #if GUIDEMO_USE_AUTO_BK
  1026. //
  1027. // Determine if HW has enough memory to draw the gradient circle as background
  1028. //
  1029. BitsPerPixel = LCD_GetBitsPerPixel();
  1030. if ((BitsPerPixel >= 16) && GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_AUTO_BK)) {
  1031. NumFreeBytes = GUI_ALLOC_GetNumFreeBytes();
  1032. if (NumFreeBytes > NUMBYTES_NEEDED) {
  1033. #if GUI_SUPPORT_MEMDEV
  1034. _pfDrawBk = _DrawBkCircle;
  1035. #else
  1036. _pfDrawBk = _DrawBk;
  1037. #endif
  1038. } else {
  1039. _pfDrawBk = _DrawBk;
  1040. }
  1041. } else
  1042. #endif
  1043. {
  1044. _pfDrawBk = _DrawBkSimple;
  1045. }
  1046. while (1) {
  1047. _Main();
  1048. }
  1049. }
  1050. /*********************************************************************
  1051. *
  1052. * GUIDEMO_MixColors
  1053. */
  1054. GUI_COLOR GUIDEMO_MixColors(GUI_COLOR Color, GUI_COLOR Color0, U8 Intens) {
  1055. U32 r, g, b, a;
  1056. U8 Intens0;
  1057. #if (GUI_USE_ARGB)
  1058. if (Color0 & 0xFF000000) {
  1059. #else
  1060. if ((Color0 & 0xFF000000) != 0xFF000000) {
  1061. #endif
  1062. //
  1063. // Calculate Color separations for FgColor first
  1064. //
  1065. r = ( Color & 0x000000ff) * Intens;
  1066. g = ( Color & 0x0000ff00) * Intens;
  1067. b = ( Color & 0x00ff0000) * Intens;
  1068. a = ((Color & 0xff000000) >> 24) * Intens;
  1069. //
  1070. // Add Color separations for Color0
  1071. //
  1072. Intens0 = 255 - Intens;
  1073. r += ( Color0 & 0x000000ff) * Intens0;
  1074. g += ( Color0 & 0x0000ff00) * Intens0;
  1075. b += ( Color0 & 0x00ff0000) * Intens0;
  1076. a += ((Color0 & 0xff000000) >> 24) * Intens0;
  1077. r = (r >> 8) & 0x000000ff;
  1078. g = (g >> 8) & 0x0000ff00;
  1079. b = (b >> 8) & 0x00ff0000;
  1080. a = (a << (24 - 8)) & 0xff000000;
  1081. Color = r | g | b | a;
  1082. }
  1083. return Color;
  1084. }
  1085. /*********************************************************************
  1086. *
  1087. * GUIDEMO_ShiftRight
  1088. */
  1089. int GUIDEMO_ShiftRight(int Value, U8 NumBits) {
  1090. int Shift;
  1091. U8 i;
  1092. Shift = 2;
  1093. for (i = NumBits - 1; i > 0; i--) {
  1094. Shift *= 2;
  1095. }
  1096. return Value / Shift;
  1097. }
  1098. /*********************************************************************
  1099. *
  1100. * GUIDEMO_Wait
  1101. *
  1102. * This function has to be called if the current step is a static
  1103. * frame and another step will follow
  1104. */
  1105. void GUIDEMO_Wait(int TimeWait) {
  1106. GUIDEMO_Delay(TimeWait);
  1107. GUIDEMO_NotifyStartNext();
  1108. }
  1109. /*************************** End of file ****************************/