اطلاعیه

Collapse
No announcement yet.

سوال در مورداستفاده از وفقه در emwin

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    سوال در مورداستفاده از وفقه در emwin

    سلام .
    من یه پروژه دارم کار می کنم که با emwin هستش توی این پروژه تسک ها مربوط به سیستم عامل به خوبی کار می کننو و ولی زمانی که زیر برنامه وفقه timer0 (که هر یک ثانیه یک بار وارد زیر برنامه موبوط تایمر میشه و یک ال ای دی رو روشن و خاموش می کنه)بر نامه کار نمی کنه و میکرو هنگ میکنه به نظر شما مشکل کجاست

    /*********************************************************************
    * SEGGER Microcontroller GmbH & Co. KG *
    * Solutions for real time microcontroller applications *
    **********************************************************************
    * *
    * (c) 1996 - 2012 SEGGER Microcontroller GmbH & Co. KG *
    * *
    * Internet: www.segger.com Support: support@segger.com *
    * *
    **********************************************************************

    ** emWin V5.18 - Graphical user interface for embedded applications **
    All Intellectual Property rights in the Software belongs to SEGGER.
    emWin is protected by international copyright laws. Knowledge of the
    source code may not be used to write a similar product. This file may
    only be used in accordance with the following terms:
    The software has been licensed to NXP Semiconductors USA, Inc. whose
    registered office is situated at 1109 McKay Dr, M/S 76, San Jose,
    CA 95131, USA solely for the purposes of creating libraries for
    NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and
    distributed under the terms and conditions of the NXP End User License
    Agreement.
    Full source code is available at: www.segger.com

    We appreciate your understanding and fairness.
    ----------------------------------------------------------------------
    File : Main.c
    Purpose : Call of MainTask
    --------------------END-OF-HEADER-------------------------------------
    */


    #include "RTL.h"


    #include "TouchPanel.h"
    #include "debug_frmwrk.h"
    #include "lpc177x_8x_rtc.h"
    #include "lpc177x_8x_clkpwr.h"
    #include "lpc177x_8x_eeprom.h"

    #include "lpc177x_8x_adc.h"
    #include "appl.h"
    #include "BSP.h"
    #include "SDRAM_K4S561632C_32M_16BIT.h"
    #include "WM.h"
    #include "AT24C02.h"
    #include "lpc177x_8x_timer.h"

    WM_HWIN hWinMainPage=0;
    void Initial_display(void);
    void CheckTouchCalibration(void);
    WM_HWIN CreateSample(void);

    int PhX[2],PhY[2],led=1;
    int xPhys, yPhys,TP_State,NT;

    __task void MainTask(void);
    __task void TouchTask(void);
    __task void M_GUI_Task(void);
    __task void _rt(void);
    __task void Read_Touch(void);

    void TIMER1_IRQHandler(){
    if (TIM_GetIntStatus(LPC_TIM1,TIM_MR0_INT)==1){
    if (led==1){
    led=2;
    GPIO_SetValue(1,1<<18);
    }
    else{
    led=1;
    GPIO_ClearValue(1,1<<18);
    }
    TIM_ClearIntPending(LPC_TIM1,TIM_MR0_INT);
    }





    }
    //__task void USB_Host_Task(void);

    /*********************************************************************
    *
    * __low_level_init()
    *
    * Initialize memory controller, clock generation and pll
    *
    * Has to be modified, if another CPU clock frequency should be
    * used. This function is called during startup and
    * has to return 1 to perform segment initialization
    */
    #ifdef __cplusplus
    extern "C" {
    #endif
    int __low_level_init(void); // Avoid "no ptototype" warning
    #ifdef __cplusplus
    }
    #endif
    int __low_level_init(void) {

    SystemCoreClockUpdate(); // Ensure, the SystemCoreClock is set
    SDRAM_32M_16BIT_Init();

    return 1;
    }

    void MainTaskT(void) ;
    /*********************************************************************
    *
    * main
    */
    static U64 gui_stk [2200];
    static U64 Main_stk[2200];

    int main(void)
    {

    TIM_TIMERCFG_Type Timer_CFG;
    TIM_MATCHCFG_Type Timer_CFG_Sample;

    Timer_CFG.PrescaleOption=TIM_PRESCALE_USVAL;
    Timer_CFG.PrescaleValue=1;
    TIM_Init(LPC_TIM1,TIM_TIMER_MODE,&Timer_CFG);

    Timer_CFG_Sample.MatchChannel=0;
    Timer_CFG_Sample.IntOnMatch=ENABLE;
    Timer_CFG_Sample.ResetOnMatch=DISABLE;
    Timer_CFG_Sample.MatchValue=500000;
    TIM_ConfigMatch(LPC_TIM1,&Timer_CFG_Sample);

    Timer_CFG_Sample.MatchChannel=1;
    Timer_CFG_Sample.IntOnMatch=ENABLE;
    Timer_CFG_Sample.ResetOnMatch=ENABLE;
    Timer_CFG_Sample.MatchValue=1000000;
    TIM_ConfigMatch(LPC_TIM1,&Timer_CFG_Sample);

    TIM_Cmd(LPC_TIM1,ENABLE);
    NVIC_EnableIRQ(TIMER1_IRQn);
    // GPIO_SetDir(4, 1<<1, 1);

    debug_frmwrk_init();

    TP_Init();
    I2C_Configuration();



    os_sys_init_prio(_rt,1);
    while(1)
    {
    // GUI_X_Delay(100);
    }
    }

    //*********************************************************************
    /*********************************************************************/

    void _rt()
    {

    GUI_Init();
    WM_Init();
    WM_SetCreateFlags(WM_CF_MEMDEV);

    os_tsk_create(Read_Touch,1);
    os_tsk_create(TouchTask,2);
    os_tsk_create_user(M_GUI_Task,3,&gui_stk,sizeof(gui_stk));
    os_tsk_create_user(MainTask,4,&Main_stk,sizeof(Main_stk));

    os_tsk_delete_self();

    }
    //*********************************************************************
    //*********************************************************************
    void TouchTask()
    {

    while(1)
    {
    GUI_TOUCH_Exec();
    GUI_X_Delay(10);
    }
    }
    /*********************************************************************/
    /*********************************************************************/
    void M_GUI_Task(void)
    {

    while(1)
    {
    GUI_Exec();
    WM_Exec();
    GUI_X_Delay(1);

    }

    }
    /*********************************************************************/
    /*********************************************************************/
    void MainTask(void)
    {
    BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
    CHECKBOX_SetDefaultSkin (CHECKBOX_SKIN_FLEX);
    DROPDOWN_SetDefaultSkin (DROPDOWN_SKIN_FLEX);
    // FRAMEWIN_SetDefaultSkin (FRAMEWIN_SKIN_FLEX);
    HEADER_SetDefaultSkin (HEADER_SKIN_FLEX);
    // PROGBAR_SetDefaultSkin (PROGBAR_SKIN_FLEX);
    // RADIO_SetDefaultSkin (RADIO_SKIN_FLEX);
    SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
    SLIDER_SetDefaultSkin (SLIDER_SKIN_FLEX);
    SPINBOX_SetDefaultSkin (SPINBOX_SKIN_FLEX);

    SCROLLBAR_SetDefaultWidth(30);



    GUI_X_Delay(100);

    Initial_display();

    CheckTouchCalibration();

    GUI_CURSOR_Show();

    hWinMainPage = CreateSample();
    WM_PaintWindowAndDescs(hWinMainPage);

    WM_ShowWindow (hWinMainPage);


    while(1)
    {

    GUI_X_Delay(100);
    }
    }

    جدیدترین ویرایش توسط MM320; ۱۶:۵۷ ۱۳۹۵/۱۱/۱۲.

    #2
    پاسخ : سوال در مورداستفاده از وفقه در emwin

    سلام دوست عزیز
    احتمال زیاد اگه از تابع GUI_Delay به جای GUI_X_Delay استفاده کنید درست میشه
    موفق باشید
    برای آنکه کاری امکان پذیر گردد دیدگان دیگری لازم است، دیدگانی نو

    دیدگاه

    لطفا صبر کنید...
    X