Hi !
I'm starting the finalization of my new project based on a LPC4350 (8MB SPIFI + 64MB SDRAM).
I'm using the EmWin library provided by NXP (emWin_520_Keil460_M4_LE.lib).
The application displays "animations", which are no more than a succession of .dta files stored in SPIFI.
The application windows are based on the Window Manager.
I would like to optimize the speed of the animation.
One way is to excecute some part of emWin from the internal RAM (5x faster than SPIFI).
Because I don't have the source code, and still not my JTAG with performance analyser, could you please indicate me which files are the most "CPU consumming" for displaying DTA images ?
I have already done this optimization for my OS (FreeRTOS) and my Ethernet stack (LwIP).
Thank you very much for your support.
Laurent
Hereafter, an exemple of a window creation with animation inside.
ani_start() launches a timer. On timer end, the new DTA file is displayed.
Display All
I'm starting the finalization of my new project based on a LPC4350 (8MB SPIFI + 64MB SDRAM).
I'm using the EmWin library provided by NXP (emWin_520_Keil460_M4_LE.lib).
The application displays "animations", which are no more than a succession of .dta files stored in SPIFI.
The application windows are based on the Window Manager.
I would like to optimize the speed of the animation.
One way is to excecute some part of emWin from the internal RAM (5x faster than SPIFI).
Because I don't have the source code, and still not my JTAG with performance analyser, could you please indicate me which files are the most "CPU consumming" for displaying DTA images ?
I have already done this optimization for my OS (FreeRTOS) and my Ethernet stack (LwIP).
Thank you very much for your support.
Laurent
Hereafter, an exemple of a window creation with animation inside.
ani_start() launches a timer. On timer end, the new DTA file is displayed.
C Source Code
- /*********************************************************************
- * *
- * SEGGER Microcontroller GmbH & Co. KG *
- * Solutions for real time microcontroller applications *
- * *
- **********************************************************************
- * *
- * C-file generated by: *
- * *
- * GUI_Builder for emWin version 5.16 *
- * Compiled Jun 4 2012, 15:48:59 *
- * (c) 2011 Segger Microcontroller GmbH & Co. KG *
- * *
- **********************************************************************
- * *
- * Internet: www.segger.com Support: support@segger.com *
- * *
- **********************************************************************
- */
- // USER START (Optionally insert additional includes)
- // USER END
- #include "DIALOG.h"
- #include "MMI_eraseDLG.h"
- #include "romfs_spifi.h"
- #include "GUI_main.h"
- #include "GUI_common.h"
- #include "MMI_configuration.h"
- #include "status_collector.h"
- #include "fpga_task.h"
- #include "door_task.h"
- #include "database.h"
- #include "product_configuration.h"
- #include "lpc_arch.h"
- #include "led_output.h"
- /*********************************************************************
- *
- * Defines
- *
- **********************************************************************
- */
- #define ID_WINDOW_0 (GUI_ID_USER + 0x00)
- #define ID_IMAGE_0 (GUI_ID_USER + 0x01)
- //#define ID_IMAGE_1 (GUI_ID_USER + 0x02)
- #define ID_IMAGE_2 (GUI_ID_USER + 0x03)
- #define ID_IMAGE_3 (GUI_ID_USER + 0x04)
- #define ID_IMAGE_4 (GUI_ID_USER + 0x05)
- #define ID_TEXT_0 (GUI_ID_USER + 0x06)
- // USER START (Optionally insert additional defines)
- #define ERASE_PRESS_NONE 0
- #define ERASE_PRESS_PARAM 1
- #define ERASE_PRESS_HOME 2
- #define ERASE_STATE_WAIT 1
- #define ERASE_STATE_RETURN 2
- #define ERASE_STATE_ERASE 3
- // USER END
- extern uint32_t door_task_state;
- /*********************************************************************
- *
- * Static data
- *
- **********************************************************************
- */
- // USER START (Optionally insert additional static data)
- extern struct gui_win_struct gui_win;
- extern char mmi_dyn_txt[100];
- extern uint32_t key_state;
- extern GUI_PID_STATE my_ts_state;
- uint16_t erase_state;
- uint16_t erase_state_last;
- uint32_t erase_force_motor_cpt;
- // USER END
- /*********************************************************************
- *
- * _aDialogCreate
- */
- static const GUI_WIDGET_CREATE_INFO _aDialogCreate[] = {
- { WINDOW_CreateIndirect, "MMI_connected", ID_WINDOW_0, 0, 0, 320, 240, 0, 0, 0 },
- { IMAGE_CreateIndirect, "background", ID_IMAGE_0, 0, 0, 320, 240, 0, 0, 0 },
- // { IMAGE_CreateIndirect, "anim_static", ID_IMAGE_1, 20, 50, 120, 170, 0, 0, 0 },
- { IMAGE_CreateIndirect, "anim_mov", ID_IMAGE_2, ANI_POS_X, ANI_POS_Y, ANI_X, ANI_Y, 0, 0, 0 },
- { IMAGE_CreateIndirect, "home", ID_IMAGE_3, HOX, HOY, ISX, ISY, 0, 0, 0 },
- { IMAGE_CreateIndirect, "param", ID_IMAGE_4, POX, POY, ISX, ISY, 0, 0, 0 },
- { TEXT_CreateIndirect, "progress", ID_TEXT_0, 170, 80, 120, 50, 0, 100, 0 },
- // USER START (Optionally insert additional widgets)
- // USER END
- };
- /*********************************************************************
- *
- * Static code
- *
- **********************************************************************
- */
- // USER START (Optionally insert additional static code)
- // USER END
- /*********************************************************************
- *
- * _cbDialog
- */
- static void _cbDialog(WM_MESSAGE * pMsg) {
- WM_HWIN hItem;
- int Id, NCode;
- // USER START (Optionally insert additional variables)
- erase_force_motor_cpt = 0;
- // USER END
- switch (pMsg->MsgId) {
- case WM_INIT_DIALOG:
- mmi_window_timeout_reset();
- reset_image_button();
- key_state = KEY_RELEASED;
- erase_state = ERASE_STATE_WAIT;
- //
- // Initialization of 'background'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_0);
- display_picture_from_rom(hItem, IMG_ERAS_BACKGROUND);
- //
- // Initialization of 'anim_mov'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_2);
- display_picture_from_rom(hItem, IMG_ERAS_ANI_INSERT);
- ani_start();
- //
- // Initialization of 'home'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_3);
- display_picture_from_rom(hItem, IMG_ERAS_HOME);
- //add_image_action(ERASE_PRESS_HOME, ID_IMAGE_3, nb_element, _aDialogCreate);
- //
- // Initialization of 'param'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_4);
- display_picture_from_rom(hItem, IMG_ERAS_PARAM);
- //add_image_action(ERASE_PRESS_PARAM, ID_IMAGE_4, nb_element, _aDialogCreate);
- //
- // Initialization of 'progress'
- //
- hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
- TEXT_SetTextAlign(hItem, GUI_TA_LEFT | GUI_TA_VCENTER);
- TEXT_SetFont(hItem, FONT_ERAS_PROGRESS);
- TEXT_SetTextColor(hItem, COLOR_ERAS_PROGRESS);
- TEXT_SetText(hItem, "");
- // USER START (Optionally insert additional code for further widget initialization)
- // USER END
- break;
- case WM_NOTIFY_PARENT:
- //int Id, NCode;
- if ((key_state != KEY_BLOCKED) && (erase_state == ERASE_STATE_WAIT)) {
- Id = WM_GetId(pMsg->hWinSrc);
- NCode = pMsg->Data.v;
- switch(Id) {
- case ID_IMAGE_3: // Notifications sent by 'home'
- switch(NCode) {
- case WM_NOTIFICATION_RELEASED:
- mmi_back_home();
- door_end_force_motor();
- key_state = KEY_BLOCKED;
- break;
- default:
- break;
- }
- break;
- case ID_IMAGE_4: // Notifications sent by 'param'
- switch(NCode) {
- case WM_NOTIFICATION_RELEASED:
- mmi_exit_to(WIN_MENU_CREATE);
- // gui_win.exit_request = 1;
- // gui_win.next_window = WIN_MENU_CREATE;
- key_state = KEY_BLOCKED;
- break;
- default:
- break;
- }
- break;
- case ID_IMAGE_2: // Notifications sent by 'erase'
- switch(NCode) {
- case WM_NOTIFICATION_CLICKED:
- ani_stop();
- door_force_motor();
- mmi_window_timeout_reset();
- break;
- case WM_NOTIFICATION_RELEASED:
- while (DOOR_SCAN_sWAIT_END_MOTOR != door_task_state) {
- msDelay(100);
- erase_force_motor_cpt ++;
- if (erase_force_motor_cpt > 20) {
- door_end_force_motor();
- ani_start();
- break;
- }
- mmi_window_timeout_reset();
- }
- door_end_force_motor();
- ani_start();
- break;
- case WM_NOTIFICATION_MOVED_OUT:
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- break;
- // USER START (Optionally insert additional message handling)
- // USER END
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
- /*********************************************************************
- *
- * Public code
- *
- **********************************************************************
- */
- /*********************************************************************
- *
- * CreateMMI_connected
- */
- //WM_HWIN CreateMMI_connected(void);
- WM_HWIN CreateMMI_erase(void) {
- WM_HWIN hWin;
- hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbDialog, WM_HBKWIN, 0, 0);
- return hWin;
- }
- // USER START (Optionally insert additional public code)
- // USER END
- /*************************** End of file ****************************/