this repository aim to make the official ST DISCO F746NG demo from STM32Cube_FW_F7_V1.2.0 working on mbed.
Dependencies: BSP_DISCO_F746NG_patch mbed-rtos mbed
Modules/settings/settings_win.c@0:c00e6c923941, 2015-11-02 (annotated)
- Committer:
- NirT
- Date:
- Mon Nov 02 23:38:08 2015 +0000
- Revision:
- 0:c00e6c923941
Error: Incomplete type is not allowed in "patch/LwIP/src/include/lwip/dhcp.h", Line: 83, Col: 4; ; and more like this.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NirT | 0:c00e6c923941 | 1 | /** |
NirT | 0:c00e6c923941 | 2 | ****************************************************************************** |
NirT | 0:c00e6c923941 | 3 | * @file settings_win.c |
NirT | 0:c00e6c923941 | 4 | * @author MCD Application Team |
NirT | 0:c00e6c923941 | 5 | * @version V1.1.0 |
NirT | 0:c00e6c923941 | 6 | * @date 21-September-2015 |
NirT | 0:c00e6c923941 | 7 | * @brief settings functions |
NirT | 0:c00e6c923941 | 8 | ****************************************************************************** |
NirT | 0:c00e6c923941 | 9 | * @attention |
NirT | 0:c00e6c923941 | 10 | * |
NirT | 0:c00e6c923941 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
NirT | 0:c00e6c923941 | 12 | * |
NirT | 0:c00e6c923941 | 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
NirT | 0:c00e6c923941 | 14 | * You may not use this file except in compliance with the License. |
NirT | 0:c00e6c923941 | 15 | * You may obtain a copy of the License at: |
NirT | 0:c00e6c923941 | 16 | * |
NirT | 0:c00e6c923941 | 17 | * http://www.st.com/software_license_agreement_liberty_v2 |
NirT | 0:c00e6c923941 | 18 | * |
NirT | 0:c00e6c923941 | 19 | * Unless required by applicable law or agreed to in writing, software |
NirT | 0:c00e6c923941 | 20 | * distributed under the License is distributed on an "AS IS" BASIS, |
NirT | 0:c00e6c923941 | 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
NirT | 0:c00e6c923941 | 22 | * See the License for the specific language governing permissions and |
NirT | 0:c00e6c923941 | 23 | * limitations under the License. |
NirT | 0:c00e6c923941 | 24 | * |
NirT | 0:c00e6c923941 | 25 | ****************************************************************************** |
NirT | 0:c00e6c923941 | 26 | */ |
NirT | 0:c00e6c923941 | 27 | |
NirT | 0:c00e6c923941 | 28 | /* Includes ------------------------------------------------------------------*/ |
NirT | 0:c00e6c923941 | 29 | #include "main.h" |
NirT | 0:c00e6c923941 | 30 | #include "settings_res.c" |
NirT | 0:c00e6c923941 | 31 | |
NirT | 0:c00e6c923941 | 32 | /** @addtogroup SETTINGS_MODULE |
NirT | 0:c00e6c923941 | 33 | * @{ |
NirT | 0:c00e6c923941 | 34 | */ |
NirT | 0:c00e6c923941 | 35 | |
NirT | 0:c00e6c923941 | 36 | /** @defgroup SETTINGS |
NirT | 0:c00e6c923941 | 37 | * @brief settings routines |
NirT | 0:c00e6c923941 | 38 | * @{ |
NirT | 0:c00e6c923941 | 39 | */ |
NirT | 0:c00e6c923941 | 40 | |
NirT | 0:c00e6c923941 | 41 | /* External variables --------------------------------------------------------*/ |
NirT | 0:c00e6c923941 | 42 | /* Private function prototypes -----------------------------------------------*/ |
NirT | 0:c00e6c923941 | 43 | static void Startup(WM_HWIN hWin, uint16_t xpos, uint16_t ypos); |
NirT | 0:c00e6c923941 | 44 | |
NirT | 0:c00e6c923941 | 45 | /* Private typedef -----------------------------------------------------------*/ |
NirT | 0:c00e6c923941 | 46 | K_ModuleItem_Typedef settings_board = |
NirT | 0:c00e6c923941 | 47 | { |
NirT | 0:c00e6c923941 | 48 | 7, |
NirT | 0:c00e6c923941 | 49 | "system info", |
NirT | 0:c00e6c923941 | 50 | settings, |
NirT | 0:c00e6c923941 | 51 | 0, |
NirT | 0:c00e6c923941 | 52 | Startup, |
NirT | 0:c00e6c923941 | 53 | NULL, |
NirT | 0:c00e6c923941 | 54 | } |
NirT | 0:c00e6c923941 | 55 | ; |
NirT | 0:c00e6c923941 | 56 | |
NirT | 0:c00e6c923941 | 57 | /* Private defines -----------------------------------------------------------*/ |
NirT | 0:c00e6c923941 | 58 | #define ID_WINDOW_0 (GUI_ID_USER + 0x00) |
NirT | 0:c00e6c923941 | 59 | |
NirT | 0:c00e6c923941 | 60 | #define ID_TEXT_BOARD (GUI_ID_USER + 0x02) |
NirT | 0:c00e6c923941 | 61 | #define ID_TEXT_CORE (GUI_ID_USER + 0x03) |
NirT | 0:c00e6c923941 | 62 | #define ID_TEXT_CPU (GUI_ID_USER + 0x04) |
NirT | 0:c00e6c923941 | 63 | #define ID_TEXT_VERSION (GUI_ID_USER + 0x05) |
NirT | 0:c00e6c923941 | 64 | #define ID_TEXT_COPYRIGHT (GUI_ID_USER + 0x06) |
NirT | 0:c00e6c923941 | 65 | #define ID_TEXT_BOARD_1 (GUI_ID_USER + 0x07) |
NirT | 0:c00e6c923941 | 66 | #define ID_TEXT_BOARD_2 (GUI_ID_USER + 0x0C) |
NirT | 0:c00e6c923941 | 67 | |
NirT | 0:c00e6c923941 | 68 | #define ID_TEXT_CORE_1 (GUI_ID_USER + 0x08) |
NirT | 0:c00e6c923941 | 69 | #define ID_TEXT_CPU_1 (GUI_ID_USER + 0x09) |
NirT | 0:c00e6c923941 | 70 | #define ID_TEXT_VERSION_1 (GUI_ID_USER + 0x0A) |
NirT | 0:c00e6c923941 | 71 | #define ID_TEXT_TITLE (GUI_ID_USER + 0x0B) |
NirT | 0:c00e6c923941 | 72 | |
NirT | 0:c00e6c923941 | 73 | #define ID_BUTTON_EXIT (GUI_ID_USER + 0x20) |
NirT | 0:c00e6c923941 | 74 | |
NirT | 0:c00e6c923941 | 75 | #define ID_IMAGE_BOARD (GUI_ID_USER + 0x21) |
NirT | 0:c00e6c923941 | 76 | #define ID_IMAGE_MCU (GUI_ID_USER + 0x22) |
NirT | 0:c00e6c923941 | 77 | #define ID_IMAGE_CPU (GUI_ID_USER + 0x23) |
NirT | 0:c00e6c923941 | 78 | #define ID_IMAGE_FVERSION (GUI_ID_USER + 0x24) |
NirT | 0:c00e6c923941 | 79 | |
NirT | 0:c00e6c923941 | 80 | /* Private macros ------------------------------------------------------------*/ |
NirT | 0:c00e6c923941 | 81 | /* Private variables ---------------------------------------------------------*/ |
NirT | 0:c00e6c923941 | 82 | static const GUI_WIDGET_CREATE_INFO _aDialog[] = |
NirT | 0:c00e6c923941 | 83 | { |
NirT | 0:c00e6c923941 | 84 | { WINDOW_CreateIndirect, "", ID_WINDOW_0, 0, 0, 480, 272, 0, 0x64, 0 }, |
NirT | 0:c00e6c923941 | 85 | { TEXT_CreateIndirect, "System Information", ID_TEXT_TITLE, 160, 20, 300, 40, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 86 | { TEXT_CreateIndirect, "Board", ID_TEXT_BOARD, 57, 90, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 87 | { TEXT_CreateIndirect, "Core", ID_TEXT_CORE, 170, 90, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 88 | { TEXT_CreateIndirect, "CPU Speed", ID_TEXT_CPU, 260, 90, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 89 | { TEXT_CreateIndirect, "Firm.Ver", ID_TEXT_VERSION, 378, 90, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 90 | |
NirT | 0:c00e6c923941 | 91 | { TEXT_CreateIndirect, " STM32F746G", ID_TEXT_BOARD_1, 30, 190, 90, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 92 | { TEXT_CreateIndirect, " DISCO", ID_TEXT_BOARD_2, 40, 205, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 93 | { TEXT_CreateIndirect, " STM32F7", ID_TEXT_CORE_1, 153, 200, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 94 | { TEXT_CreateIndirect, " 200MHz", ID_TEXT_CPU_1, 265, 200, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 95 | /* The demonstration version */ |
NirT | 0:c00e6c923941 | 96 | { TEXT_CreateIndirect, "V1.1.0 ", ID_TEXT_VERSION_1, 385, 200, 80, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 97 | |
NirT | 0:c00e6c923941 | 98 | { TEXT_CreateIndirect, "Copyright (c) STMicroelectronics 2015", ID_TEXT_COPYRIGHT, 260, 253, 240, 20, 0, 0x0, 0 }, |
NirT | 0:c00e6c923941 | 99 | }; |
NirT | 0:c00e6c923941 | 100 | |
NirT | 0:c00e6c923941 | 101 | static WM_HWIN SystemWin; |
NirT | 0:c00e6c923941 | 102 | static WM_HTIMER hTimer; |
NirT | 0:c00e6c923941 | 103 | uint32_t frame = 0; |
NirT | 0:c00e6c923941 | 104 | |
NirT | 0:c00e6c923941 | 105 | /* Private functions ---------------------------------------------------------*/ |
NirT | 0:c00e6c923941 | 106 | |
NirT | 0:c00e6c923941 | 107 | /** |
NirT | 0:c00e6c923941 | 108 | * @brief Paints exit button |
NirT | 0:c00e6c923941 | 109 | * @param hObj: button handle |
NirT | 0:c00e6c923941 | 110 | * @retval None |
NirT | 0:c00e6c923941 | 111 | */ |
NirT | 0:c00e6c923941 | 112 | static void _OnPaint_exit(BUTTON_Handle hObj) { |
NirT | 0:c00e6c923941 | 113 | |
NirT | 0:c00e6c923941 | 114 | GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor()); |
NirT | 0:c00e6c923941 | 115 | GUI_Clear(); |
NirT | 0:c00e6c923941 | 116 | |
NirT | 0:c00e6c923941 | 117 | GUI_SetColor(GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 118 | GUI_AA_FillCircle(60, 0, 60); |
NirT | 0:c00e6c923941 | 119 | |
NirT | 0:c00e6c923941 | 120 | GUI_SetBkColor(GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 121 | GUI_SetColor(GUI_WHITE); |
NirT | 0:c00e6c923941 | 122 | GUI_SetFont(&GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 123 | GUI_DispStringAt("Menu", 15, 13); |
NirT | 0:c00e6c923941 | 124 | } |
NirT | 0:c00e6c923941 | 125 | |
NirT | 0:c00e6c923941 | 126 | /** |
NirT | 0:c00e6c923941 | 127 | * @brief callback for Exit button |
NirT | 0:c00e6c923941 | 128 | * @param pMsg: pointer to data structure of type WM_MESSAGE |
NirT | 0:c00e6c923941 | 129 | * @retval None |
NirT | 0:c00e6c923941 | 130 | */ |
NirT | 0:c00e6c923941 | 131 | static void _cbButton_exit(WM_MESSAGE * pMsg) { |
NirT | 0:c00e6c923941 | 132 | switch (pMsg->MsgId) { |
NirT | 0:c00e6c923941 | 133 | case WM_PAINT: |
NirT | 0:c00e6c923941 | 134 | _OnPaint_exit(pMsg->hWin); |
NirT | 0:c00e6c923941 | 135 | break; |
NirT | 0:c00e6c923941 | 136 | default: |
NirT | 0:c00e6c923941 | 137 | /* The original callback */ |
NirT | 0:c00e6c923941 | 138 | BUTTON_Callback(pMsg); |
NirT | 0:c00e6c923941 | 139 | break; |
NirT | 0:c00e6c923941 | 140 | } |
NirT | 0:c00e6c923941 | 141 | } |
NirT | 0:c00e6c923941 | 142 | |
NirT | 0:c00e6c923941 | 143 | static void _cbDialog(WM_MESSAGE * pMsg) { |
NirT | 0:c00e6c923941 | 144 | WM_HWIN hItem; |
NirT | 0:c00e6c923941 | 145 | int Id, NCode; |
NirT | 0:c00e6c923941 | 146 | |
NirT | 0:c00e6c923941 | 147 | |
NirT | 0:c00e6c923941 | 148 | switch (pMsg->MsgId) { |
NirT | 0:c00e6c923941 | 149 | case WM_INIT_DIALOG: |
NirT | 0:c00e6c923941 | 150 | |
NirT | 0:c00e6c923941 | 151 | hItem = BUTTON_CreateEx(420, 0, 60, 60, pMsg->hWin, WM_CF_SHOW, 0, ID_BUTTON_EXIT); |
NirT | 0:c00e6c923941 | 152 | WM_SetCallback(hItem, _cbButton_exit); |
NirT | 0:c00e6c923941 | 153 | |
NirT | 0:c00e6c923941 | 154 | /* Initialization of 'Board : STM324x9I' */ |
NirT | 0:c00e6c923941 | 155 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_BOARD); |
NirT | 0:c00e6c923941 | 156 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 157 | TEXT_SetTextColor(hItem, GUI_STCOLOR_DARKBLUE ); |
NirT | 0:c00e6c923941 | 158 | |
NirT | 0:c00e6c923941 | 159 | /* Initialization of 'Core: STM32F-4 Series' */ |
NirT | 0:c00e6c923941 | 160 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_CORE); |
NirT | 0:c00e6c923941 | 161 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 162 | TEXT_SetTextColor(hItem, GUI_STCOLOR_DARKBLUE ); |
NirT | 0:c00e6c923941 | 163 | |
NirT | 0:c00e6c923941 | 164 | /* Initialization of 'CPU Speed : 180MHz' */ |
NirT | 0:c00e6c923941 | 165 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_CPU); |
NirT | 0:c00e6c923941 | 166 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 167 | TEXT_SetTextColor(hItem, GUI_STCOLOR_DARKBLUE ); |
NirT | 0:c00e6c923941 | 168 | |
NirT | 0:c00e6c923941 | 169 | /* Initialization of 'Firmware Version : 1.0.1' */ |
NirT | 0:c00e6c923941 | 170 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_VERSION); |
NirT | 0:c00e6c923941 | 171 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 172 | TEXT_SetTextColor(hItem, GUI_STCOLOR_DARKBLUE ); |
NirT | 0:c00e6c923941 | 173 | |
NirT | 0:c00e6c923941 | 174 | /* Initialization of 'Board : STM324x9I' */ |
NirT | 0:c00e6c923941 | 175 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_BOARD_1); |
NirT | 0:c00e6c923941 | 176 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 177 | TEXT_SetTextColor(hItem, GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 178 | |
NirT | 0:c00e6c923941 | 179 | /* Initialization of 'Board : STM32F746G' */ |
NirT | 0:c00e6c923941 | 180 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_BOARD_2); |
NirT | 0:c00e6c923941 | 181 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 182 | TEXT_SetTextColor(hItem, GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 183 | |
NirT | 0:c00e6c923941 | 184 | /* Initialization of 'Core: STM32F-4 Series' */ |
NirT | 0:c00e6c923941 | 185 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_CORE_1); |
NirT | 0:c00e6c923941 | 186 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 187 | TEXT_SetTextColor(hItem, GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 188 | |
NirT | 0:c00e6c923941 | 189 | /* Initialization of 'CPU Speed : 180MHz' */ |
NirT | 0:c00e6c923941 | 190 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_CPU_1); |
NirT | 0:c00e6c923941 | 191 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 192 | TEXT_SetTextColor(hItem, GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 193 | |
NirT | 0:c00e6c923941 | 194 | /* Initialization of 'Firmware Version : 1.0' */ |
NirT | 0:c00e6c923941 | 195 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_VERSION_1); |
NirT | 0:c00e6c923941 | 196 | TEXT_SetFont(hItem, &GUI_FontLubalGraph16); |
NirT | 0:c00e6c923941 | 197 | TEXT_SetTextColor(hItem, GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 198 | /* ST Copyright */ |
NirT | 0:c00e6c923941 | 199 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_COPYRIGHT); |
NirT | 0:c00e6c923941 | 200 | TEXT_SetFont(hItem, GUI_FONT_13_ASCII); |
NirT | 0:c00e6c923941 | 201 | TEXT_SetTextColor(hItem, GUI_STCOLOR_DARKBLUE ); |
NirT | 0:c00e6c923941 | 202 | |
NirT | 0:c00e6c923941 | 203 | /* ST Copyright */ |
NirT | 0:c00e6c923941 | 204 | hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_TITLE); |
NirT | 0:c00e6c923941 | 205 | TEXT_SetFont(hItem, &GUI_FontLubalGraph20); |
NirT | 0:c00e6c923941 | 206 | TEXT_SetTextColor(hItem, GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 207 | |
NirT | 0:c00e6c923941 | 208 | IMAGE_CreateEx(40, 120, 70, 70, pMsg->hWin, WM_CF_SHOW, 0, ID_IMAGE_BOARD); |
NirT | 0:c00e6c923941 | 209 | IMAGE_CreateEx(150, 120, 70, 70, pMsg->hWin, WM_CF_SHOW, 0, ID_IMAGE_MCU); |
NirT | 0:c00e6c923941 | 210 | IMAGE_CreateEx(260, 120, 70, 70, pMsg->hWin, WM_CF_SHOW, 0, ID_IMAGE_CPU); |
NirT | 0:c00e6c923941 | 211 | IMAGE_CreateEx(370, 120, 70, 70, pMsg->hWin, WM_CF_SHOW, 0, ID_IMAGE_FVERSION); |
NirT | 0:c00e6c923941 | 212 | |
NirT | 0:c00e6c923941 | 213 | break; |
NirT | 0:c00e6c923941 | 214 | |
NirT | 0:c00e6c923941 | 215 | case WM_PAINT: |
NirT | 0:c00e6c923941 | 216 | GUI_SetColor(GUI_STCOLOR_LIGHTBLUE); |
NirT | 0:c00e6c923941 | 217 | GUI_AA_DrawRoundedRect(30, 80, 120, 230, 30); |
NirT | 0:c00e6c923941 | 218 | GUI_AA_DrawRoundedRect(140, 80, 230, 230, 30); |
NirT | 0:c00e6c923941 | 219 | GUI_AA_DrawRoundedRect(250, 80, 340, 230, 30); |
NirT | 0:c00e6c923941 | 220 | GUI_AA_DrawRoundedRect(360, 80, 450, 230, 30); |
NirT | 0:c00e6c923941 | 221 | |
NirT | 0:c00e6c923941 | 222 | break; |
NirT | 0:c00e6c923941 | 223 | |
NirT | 0:c00e6c923941 | 224 | case WM_TIMER: |
NirT | 0:c00e6c923941 | 225 | /* draw */ |
NirT | 0:c00e6c923941 | 226 | |
NirT | 0:c00e6c923941 | 227 | if(frame < 5) |
NirT | 0:c00e6c923941 | 228 | { |
NirT | 0:c00e6c923941 | 229 | WM_RestartTimer(pMsg->Data.v, 25); |
NirT | 0:c00e6c923941 | 230 | |
NirT | 0:c00e6c923941 | 231 | hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_BOARD); |
NirT | 0:c00e6c923941 | 232 | IMAGE_SetBitmap(hItem, open_board[frame]); |
NirT | 0:c00e6c923941 | 233 | |
NirT | 0:c00e6c923941 | 234 | hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_MCU); |
NirT | 0:c00e6c923941 | 235 | IMAGE_SetBitmap(hItem, open_mcu[frame]); |
NirT | 0:c00e6c923941 | 236 | |
NirT | 0:c00e6c923941 | 237 | hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_CPU); |
NirT | 0:c00e6c923941 | 238 | IMAGE_SetBitmap(hItem, open_cpu[frame]); |
NirT | 0:c00e6c923941 | 239 | |
NirT | 0:c00e6c923941 | 240 | hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_FVERSION); |
NirT | 0:c00e6c923941 | 241 | IMAGE_SetBitmap(hItem, open_fversion[frame]); |
NirT | 0:c00e6c923941 | 242 | |
NirT | 0:c00e6c923941 | 243 | frame++; |
NirT | 0:c00e6c923941 | 244 | } |
NirT | 0:c00e6c923941 | 245 | else |
NirT | 0:c00e6c923941 | 246 | { |
NirT | 0:c00e6c923941 | 247 | if(hTimer != 0) |
NirT | 0:c00e6c923941 | 248 | { |
NirT | 0:c00e6c923941 | 249 | WM_DeleteTimer(hTimer); |
NirT | 0:c00e6c923941 | 250 | hTimer = 0; |
NirT | 0:c00e6c923941 | 251 | } |
NirT | 0:c00e6c923941 | 252 | } |
NirT | 0:c00e6c923941 | 253 | break; |
NirT | 0:c00e6c923941 | 254 | |
NirT | 0:c00e6c923941 | 255 | case WM_DELETE: |
NirT | 0:c00e6c923941 | 256 | if(hTimer != 0) |
NirT | 0:c00e6c923941 | 257 | { |
NirT | 0:c00e6c923941 | 258 | WM_DeleteTimer(hTimer); |
NirT | 0:c00e6c923941 | 259 | hTimer = 0; |
NirT | 0:c00e6c923941 | 260 | } |
NirT | 0:c00e6c923941 | 261 | |
NirT | 0:c00e6c923941 | 262 | break; |
NirT | 0:c00e6c923941 | 263 | |
NirT | 0:c00e6c923941 | 264 | case WM_NOTIFY_PARENT: |
NirT | 0:c00e6c923941 | 265 | Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */ |
NirT | 0:c00e6c923941 | 266 | NCode = pMsg->Data.v; /* Notification code */ |
NirT | 0:c00e6c923941 | 267 | |
NirT | 0:c00e6c923941 | 268 | switch(Id) { |
NirT | 0:c00e6c923941 | 269 | case ID_BUTTON_EXIT: |
NirT | 0:c00e6c923941 | 270 | switch(NCode) { |
NirT | 0:c00e6c923941 | 271 | case WM_NOTIFICATION_RELEASED: |
NirT | 0:c00e6c923941 | 272 | if(hTimer != 0) |
NirT | 0:c00e6c923941 | 273 | { |
NirT | 0:c00e6c923941 | 274 | WM_DeleteTimer(hTimer); |
NirT | 0:c00e6c923941 | 275 | hTimer = 0; |
NirT | 0:c00e6c923941 | 276 | } |
NirT | 0:c00e6c923941 | 277 | GUI_EndDialog(pMsg->hWin, 0); |
NirT | 0:c00e6c923941 | 278 | |
NirT | 0:c00e6c923941 | 279 | break; |
NirT | 0:c00e6c923941 | 280 | } |
NirT | 0:c00e6c923941 | 281 | break; |
NirT | 0:c00e6c923941 | 282 | } |
NirT | 0:c00e6c923941 | 283 | break; |
NirT | 0:c00e6c923941 | 284 | default: |
NirT | 0:c00e6c923941 | 285 | WM_DefaultProc(pMsg); |
NirT | 0:c00e6c923941 | 286 | break; |
NirT | 0:c00e6c923941 | 287 | } |
NirT | 0:c00e6c923941 | 288 | } |
NirT | 0:c00e6c923941 | 289 | |
NirT | 0:c00e6c923941 | 290 | |
NirT | 0:c00e6c923941 | 291 | /** |
NirT | 0:c00e6c923941 | 292 | * @brief Game window Startup |
NirT | 0:c00e6c923941 | 293 | * @param hWin: pointer to the parent handle. |
NirT | 0:c00e6c923941 | 294 | * @param xpos: X position |
NirT | 0:c00e6c923941 | 295 | * @param ypos: Y position |
NirT | 0:c00e6c923941 | 296 | * @retval None |
NirT | 0:c00e6c923941 | 297 | */ |
NirT | 0:c00e6c923941 | 298 | static void Startup(WM_HWIN hWin, uint16_t xpos, uint16_t ypos) |
NirT | 0:c00e6c923941 | 299 | { |
NirT | 0:c00e6c923941 | 300 | frame = 0; |
NirT | 0:c00e6c923941 | 301 | SystemWin = GUI_CreateDialogBox(_aDialog, GUI_COUNTOF(_aDialog), _cbDialog, hWin, xpos, ypos); |
NirT | 0:c00e6c923941 | 302 | hTimer = WM_CreateTimer(SystemWin, 0, 100, 0); |
NirT | 0:c00e6c923941 | 303 | } |
NirT | 0:c00e6c923941 | 304 | |
NirT | 0:c00e6c923941 | 305 | /** |
NirT | 0:c00e6c923941 | 306 | * @} |
NirT | 0:c00e6c923941 | 307 | */ |
NirT | 0:c00e6c923941 | 308 | |
NirT | 0:c00e6c923941 | 309 | /** |
NirT | 0:c00e6c923941 | 310 | * @} |
NirT | 0:c00e6c923941 | 311 | */ |
NirT | 0:c00e6c923941 | 312 | |
NirT | 0:c00e6c923941 | 313 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |