野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9568|回复: 8

求助秉火STM32F429IGTX核心板系统emWin窗口数据保存时出现死机,其他正常.

[复制链接]
发表于 2018-3-17 10:14:22 | 显示全部楼层 |阅读模式

#include "includes.h"
#include  "app.h"
#include "DIALOG.h"
#include "string.h"

#define UTF8_MOVE     "\xe5\x8a\xa8\xe4\xbd\x9c"  //动作 UTF8_MOVE //步骤 UTF8_STEP  //设置 UTF8_ESTABLISH //篇幅 UTF8_ARTICLE
#define UTF8_STEP      "\xe6\xad\xa5\xe9\xaa\xa4"   //步骤 UTF8_STEP
#define UTF8_ESTABLISH      "\xe8\xae\xbe\xe7\xbd\xae"     //设置 UTF8_ESTABLISH
#define UTF8_ARTICLE      "\xe7\xaf\x87"  //篇幅 UTF8_ARTICLE
#define UTF8_speedadds    "\xe5\x8a\xa0\xe9\x80\x9f\xe5\xba\xa6" //+速度
#define UTF8_speedreduces   "\xe5\x9f\xba\xe6\x9c\xac\xe9\x80\x9f\xe5\xba\xa6 "    // 基本速度
#define UTF8_Heightadds    "\xE6\x9D\x90\xE6\x96\x99\xE9\xAB\x98\xE5\xBA\xA6\x28\x4D\x4D\x29"   //材料高度
#define UTF8_Diameteradds   "\xE6\x9D\x90\xE6\x96\x99\xE7\x9B\xB4\xE5\xBE\x84\x28\x4D\x4D\x29"  //线径
#define UTF8_Fuselage0   " "

static uint8_t num0, num1,num2,num3,num4; //+速度
static uint8_t sec0,sec1,sec2,sec3,sec4;           //线径
static uint8_t Fuselage0, Fuselage1, Fuselage2, Fuselage3,Fuselage4, Fuselage5, Fuselage6, Fuselage7;    //材料高度
static uint8_t Lowspeed0,  Lowspeed1,  Lowspeed2,  Lowspeed3,  Lowspeed4;// 基本速度

uint8_t hp=0;

#define  EEP_Firstpage      0x00
uint8_t I2c_Buf_Write[256];
uint8_t I2c_Buf_Read[256];
                              //+速度
  uint8_t test_addr1 = 0x00;
  uint8_t test_addr2 = 0x01;
  uint8_t test_addr3 = 0x02;
  uint8_t test_addr4 = 0x03;
  uint8_t test_addr5 = 0x04;
                                //线径
uint8_t Diameter_addr1 = 0x0b;  //11
uint8_t Diameter_addr2 = 0x0c;
uint8_t Diameter_addr3 = 0x0d;
uint8_t Diameter_addr4 = 0x0e;
uint8_t Diameter_addr5 = 0x0f;
                              //材料高度
uint8_t Height_addr1 = 0x14;    //20
uint8_t Height_addr2 = 0x15;
uint8_t Height_addr3 = 0x16;
uint8_t Height_addr4 = 0x17;
uint8_t Height_addr5 = 0x18;
uint8_t Height_addr6 = 0x19;
uint8_t Height_addr7 = 0x1a;
uint8_t Height_addr8 = 0x1b;
                                    // 基本速度
uint8_t speedreduces_addr1 = 0x1e;  //30
uint8_t speedreduces_addr2 = 0x1f;
uint8_t speedreduces_addr3 = 0x20;
uint8_t speedreduces_addr4 = 0x21;
uint8_t speedreduces_addr5 = 0x22;

/*********************************************************************
*
*       _aDialogCreate
*/
static const GUI_WIDGET_CREATE_INFO _aDialogCreateRGBLED[] = {
  { FRAMEWIN_CreateIndirect, "RGBLED",  0,              0,   0,   800, 480, 0, 0x0, 0 },
   { EDIT_CreateIndirect,  "rEdit0", GUI_ID_EDIT0+10,   100, 10,  30, 30,  0, 0x1, 0 },//+速度
  { EDIT_CreateIndirect,  "rEdit1", GUI_ID_EDIT0+11,   125, 10,  30, 30,  0, 0x1, 0 },
  { EDIT_CreateIndirect,  "rEdit2", GUI_ID_EDIT0+12,   150, 10,  30, 30,  0, 0x1, 0 },
  { EDIT_CreateIndirect,  "rEdit3", GUI_ID_EDIT0+13,   175, 10,  30, 30,  0, 0x1, 0 },
  { EDIT_CreateIndirect,  "rEdit4", GUI_ID_EDIT0+14,   200, 10,  30, 30,  0, 0x1, 0 },

   { EDIT_CreateIndirect,  "gEdi0t", GUI_ID_EDIT1+30,   400+90, 10,  30, 30,  0, 0x1, 0 },  //线径
  { EDIT_CreateIndirect,  "gEdi1t", GUI_ID_EDIT1+31,   425+90, 10,  30, 30,  0, 0x1, 0 },
  { EDIT_CreateIndirect,  "gEdi2t", GUI_ID_EDIT1+32,   450+90, 10,  30, 30,  0, 0x1, 0 },
  { EDIT_CreateIndirect,  "gEdi3t", GUI_ID_EDIT1+33,   475+90,  10,  30, 30,  0, 0x1, 0 },
  { EDIT_CreateIndirect,  "gEdi4t", GUI_ID_EDIT1+34,   500+90, 10,  30, 30,  0, 0x1, 0 },


  { EDIT_CreateIndirect,  "b0Edit",  GUI_ID_EDIT2+40,   400+90, 95,  30, 30,  0, 0x1, 0 },  //材料高度
{ EDIT_CreateIndirect,  "b1Edit",  GUI_ID_EDIT2+41,   425+90, 95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "b2Edit",  GUI_ID_EDIT2+42,   450+90, 95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "b3Edit",  GUI_ID_EDIT2+43,   475+90, 95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "b4Edit",  GUI_ID_EDIT2+44,   500+90, 95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "b5Edit",  GUI_ID_EDIT2+45,   525+90, 95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "b6Edit",  GUI_ID_EDIT2+46,   550+90, 95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "b7Edit",  GUI_ID_EDIT2+47,   575+90, 95,  30, 30,  0, 0x1, 0 },

  { EDIT_CreateIndirect,  "uE0dit",  GUI_ID_EDIT3+60,   100,  95,  30, 30,  0, 0x1, 0 }, // 基本速度
{ EDIT_CreateIndirect,  "uE1dit",  GUI_ID_EDIT3+61,   125,  95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "uE2dit",  GUI_ID_EDIT3+62,   150,  95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "uE3dit",  GUI_ID_EDIT3+63,   175,  95,  30, 30,  0, 0x1, 0 },
{ EDIT_CreateIndirect,  "uE4dit",  GUI_ID_EDIT3+64,   200,  95,  30, 30,  0, 0x1, 0 },



};

/*********************************************************************
*
*       _cbDialog
*/
static void _cbDialogRGBLED(WM_MESSAGE * pMsg) {
  WM_HWIN hItem;
  int     NCode;
  int     Id;
  // USER START (Optionally insert additional variables)
  char tempstr[50];
  // USER END
  switch (pMsg->MsgId) {
case WM_DELETE:
  // USER START (Optionally insert additional code for further widget initialization)
  OS_INFO("Joint4DLG delete\n");
  
  Flag_ICON5 = 0;
  UserApp_Flag = 0;
    tpad_flag=0;
  WM_DeleteWindow(hkeypad);
  //  ADC_Cmd(ADCn, DISABLE);
  // USER END
break;
  case WM_INIT_DIALOG:
    //
    // Initialization of 'RGBLED'
    //
  hItem = pMsg->hWin;
  //  sprintf(tempstr,"%s&%s",UTF8_RGBLEDDLG,UTF8_ADCONVER);
  FRAMEWIN_SetText(hItem,tempstr);
  FRAMEWIN_AddCloseButton(hItem,FRAMEWIN_BUTTON_RIGHT,0);
    //
    // Initialization of 'rEdit'

     //  num0=EEPROM_Byte_Read(test_addr1);
   //  num1=EEPROM_Byte_Read(test_addr2);
   //  num2=EEPROM_Byte_Read(test_addr3);
    // num3=EEPROM_Byte_Read(test_addr4);
    // num4=EEPROM_Byte_Read(test_addr5);
    hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+10);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,num0,0,255);  
    EDIT_EnableBlink(hItem,250,1);
  
     hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+11);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,num1,0,255);  
    EDIT_EnableBlink(hItem,250,1);
  
     hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+12);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,num2,0,255);  
    EDIT_EnableBlink(hItem,250,1);
  
     hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+13);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,num3,0,255);  
    EDIT_EnableBlink(hItem,250,1);
  
     hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+14);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,num4,0,255);  
    EDIT_EnableBlink(hItem,250,1);
    //
    // Initialization of 'gEdit'                         //线径
  /************************************************
      sec0=EEPROM_Byte_Read(Diameter_addr1);
     sec1=EEPROM_Byte_Read(Diameter_addr2);
     sec2=EEPROM_Byte_Read(Diameter_addr3);
     sec3=EEPROM_Byte_Read(Diameter_addr4);
     sec4=EEPROM_Byte_Read(Diameter_addr5);
  *************************************************/
    hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+30);
    EDIT_SetUlongMode(hItem,sec0,0,255);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_EnableBlink(hItem,250,1);
  
  hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+31);
    EDIT_SetUlongMode(hItem,sec1,0,255);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_EnableBlink(hItem,250,1);
  
  hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+32);
    EDIT_SetUlongMode(hItem,sec2,0,255);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_EnableBlink(hItem,250,1);
  
  hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+33);
    EDIT_SetUlongMode(hItem,sec3,0,255);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_EnableBlink(hItem,250,1);
  
  hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+34);
    EDIT_SetUlongMode(hItem,sec4,0,255);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_EnableBlink(hItem,250,1);
    //
    // Initialization of 'bEdit'
  
                                                                    //材料高度+40
/***********************************************
   Fuselage0=EEPROM_Byte_Read(Height_addr1);
   Fuselage1=EEPROM_Byte_Read(Height_addr2);
  Fuselage2=EEPROM_Byte_Read(Height_addr3);
  Fuselage3=EEPROM_Byte_Read(Height_addr4);
  Fuselage4=EEPROM_Byte_Read(Height_addr5);
   Fuselage5=EEPROM_Byte_Read(Height_addr6);
  Fuselage6=EEPROM_Byte_Read(Height_addr7);
  Fuselage7=EEPROM_Byte_Read(Height_addr8);
   *************************************************/
    hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+40);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage0,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
      hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+41);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage1,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
      hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+42);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage2,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
      hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+43);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage3,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
      hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+44);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage4,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
      hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+45);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage5,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
      hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+46);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage6,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
      hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+47);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Fuselage7,0,255);
    EDIT_EnableBlink(hItem,250,1);
  //

       // Initialization of 'aEdit'
   
  /******************************************                    // 基本速度+60
  Lowspeed0=EEPROM_Byte_Read(speedreduces_addr1);
  Lowspeed1=EEPROM_Byte_Read(speedreduces_addr2);
  Lowspeed2=EEPROM_Byte_Read(speedreduces_addr3);
  Lowspeed3=EEPROM_Byte_Read(speedreduces_addr4);
  Lowspeed4=EEPROM_Byte_Read(speedreduces_addr5);
  ********************************************************/
    hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+60);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Lowspeed0,0,255);
    EDIT_EnableBlink(hItem,250,1);
   
   hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+61);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Lowspeed1,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
  hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+62);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Lowspeed2,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
  hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+63);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Lowspeed3,0,255);
    EDIT_EnableBlink(hItem,250,1);
  
  hItem = WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+64);
    EDIT_SetFont(hItem, GUI_FONT_24B_ASCII);
    EDIT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
  EDIT_SetUlongMode(hItem,Lowspeed4,0,255);
    EDIT_EnableBlink(hItem,250,1);
  

  
    // USER START (Optionally insert additional code for further widget initialization)
    // USER END
    break;
  case WM_NOTIFY_PARENT:
    Id = WM_GetId(pMsg->hWinSrc);
    NCode = pMsg->Data.v;

    switch(Id) {
    case GUI_ID_EDIT0+10: // Notifications sent by 'rEdit'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:  
    // USER START (Optionally insert code for reacting on notification message)
       // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
  KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+10),0);
      
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
     Debug_USART_Config();
   I2C_EE_Init();
    num0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+10));
   I2C_EE_BufferWrite(&num0,test_addr1,256);
  
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num);
   
   WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
   
       case GUI_ID_EDIT0+11: // Notifications sent by 'rEdit'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
      
      
    // EEPROM_Byte_Write(&num1,test_addr2);
     
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
  KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+11),0);
   
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    num1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+11));
   I2C_EE_BufferWrite(&num1,test_addr2,256);
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num);
   
   WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
   
       case GUI_ID_EDIT0+12: // Notifications sent by 'rEdit'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
      
        break;
      case WM_NOTIFICATION_RELEASED:
   
  KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+12),0);
     
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
      
    num2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+12));
   I2C_EE_BufferWrite(&num2,test_addr3,256);
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num2);
   
   WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
   
       case GUI_ID_EDIT0+13: // Notifications sent by 'rEdit'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
      
     
   
   
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
  KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+13),0);
   
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    num3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+13));
   I2C_EE_BufferWrite(&num3,test_addr4,256);
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num3);
   
   WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
   
       case GUI_ID_EDIT0+14: // Notifications sent by 'rEdit'
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
      
   
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
  KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+14),0);
   
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    num4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT0+14));
    I2C_EE_BufferWrite(&num4,test_addr5,256);
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER0),num4);
   
   WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      // USER START (Optionally insert additional code for further notification handling)
      // USER END
      }
      break;
    case GUI_ID_EDIT1+30: // Notifications sent by 'gEdit'                     //线径
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+30),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    sec0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+30));
     I2C_EE_BufferWrite(&sec0,Diameter_addr1,256);  //写入保存的数据
        WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      }
      break;
   
       case GUI_ID_EDIT1+31: // Notifications sent by 'gEdit'                     //线径
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+31),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    sec1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+31));
      I2C_EE_BufferWrite(&sec1,Diameter_addr2,256);  //写入保存的数据
        WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      }
      break;
   
       case GUI_ID_EDIT1+32: // Notifications sent by 'gEdit'                     //线径
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+32),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    sec2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+32));
   I2C_EE_BufferWrite(&sec2,Diameter_addr3,256);  //写入保存的数据
        WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      }
      break;
   
       case GUI_ID_EDIT1+33: // Notifications sent by 'gEdit'                     //线径
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+33),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    sec3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+33));
         I2C_EE_BufferWrite(&sec3,Diameter_addr4,256);  //写入保存的数据
        WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      }
      break;
   
       case GUI_ID_EDIT1+34: // Notifications sent by 'gEdit'                     //线径
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+34),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    sec4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT1+34));
     I2C_EE_BufferWrite(&sec4,Diameter_addr5,256);  //写入保存的数据
        WM_InvalidateWindow(pMsg->hWin);
        // USER END
        break;
      }
      break;
   
    case GUI_ID_EDIT2+40: // Notifications sent by 'bEdit'               //材料高度 0
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+40),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+40));
     I2C_EE_BufferWrite(&Fuselage0,Height_addr1,256);  //写入保存的数据
   
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
       case GUI_ID_EDIT2+41: // Notifications sent by 'bEdit'           //材料高度 1
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+41),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+41));
   I2C_EE_BufferWrite(&Fuselage1,Height_addr2,256);  //写入保存的数据
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
       case GUI_ID_EDIT2+42: // Notifications sent by 'bEdit'               //材料高度2
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+42),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+42));
     I2C_EE_BufferWrite(&Fuselage2,Height_addr3,256);  //写入保存的数据
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
       case GUI_ID_EDIT2+43: // Notifications sent by 'bEdit'               //材料高度 3
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+43),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+43));
    I2C_EE_BufferWrite(&Fuselage3,Height_addr4,256);  //写入保存的数据
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
       case GUI_ID_EDIT2+44: // Notifications sent by 'bEdit'               //材料高度4
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+44),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+44));
   I2C_EE_BufferWrite(&Fuselage4,Height_addr5,256);  //写入保存的数据
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
       case GUI_ID_EDIT2+45: // Notifications sent by 'bEdit'               //材料高度 5
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+45),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage5=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+45));
   I2C_EE_BufferWrite(&Fuselage5,Height_addr6,256);  //写入保存的数据
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
       case GUI_ID_EDIT2+46: // Notifications sent by 'bEdit'               //材料高度 6
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+46),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage6=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+46));
   I2C_EE_BufferWrite(&Fuselage6,Height_addr7,256);  //写入保存的数据
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
       case GUI_ID_EDIT2+47: // Notifications sent by 'bEdit'               //材料高度 7
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+47),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Fuselage7=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT2+47));
  I2C_EE_BufferWrite(&Fuselage7,Height_addr8,256);  //写入保存的数据
    //SLIDER_SetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_SLIDER2),Fuselage2);
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
   break;
   
   case GUI_ID_EDIT3+60: // Notifications sent by 'bEdit'               // 基本速度0
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+60),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Lowspeed0=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+60));
    I2C_EE_BufferWrite(&Lowspeed0,speedreduces_addr1,256);  //写入保存的数据
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
      break;
   
   case GUI_ID_EDIT3+61: // Notifications sent by 'bEdit'    // 基本速度01
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+61),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Lowspeed1=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+61));
   I2C_EE_BufferWrite(&Lowspeed1,speedreduces_addr2,256);  //写入保存的数据Lowspeed
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
      break;
   
   case GUI_ID_EDIT3+62: // Notifications sent by 'bEdit'    // 基本速度02
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+62),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Lowspeed2=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+62));
    I2C_EE_BufferWrite(&Lowspeed2,speedreduces_addr3,256);  //写入保存的数据
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
      break;
   
   case GUI_ID_EDIT3+63: // Notifications sent by 'bEdit'    // 基本速度03
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+63),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Lowspeed3=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+63));
    I2C_EE_BufferWrite(&Lowspeed3,speedreduces_addr4,256);  //写入保存的数据
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
      break;
   
  case GUI_ID_EDIT3+64: // Notifications sent by 'bEdit'    // 基本速度04
      switch(NCode) {
      case WM_NOTIFICATION_CLICKED:
        // USER START (Optionally insert code for reacting on notification message)
        // USER END
        break;
      case WM_NOTIFICATION_RELEASED:
        // USER START (Optionally insert code for reacting on notification message)
    KeyPad_Interface(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+64),0);
        // USER END
        break;
      case WM_NOTIFICATION_VALUE_CHANGED:
        // USER START (Optionally insert code for reacting on notification message)
    Lowspeed4=EDIT_GetValue(WM_GetDialogItem(pMsg->hWin, GUI_ID_EDIT3+64));
    I2C_EE_BufferWrite(&Lowspeed4,speedreduces_addr5,256);  //写入保存的数据
   
        WM_InvalidateWindow(pMsg->hWin);

        break;
      }
      break;
    }
    break;
case WM_PAINT:
    GUI_SetPenSize( 2 );
    GUI_SetColor(GUI_MAGENTA );  
    GUI_SetFont(&XBF_XINSONGTI25);
    GUI_SetColor(GUI_LIGHTBLUE);   
   // GUI_DispStringHCenterAt(UTF8_MOVE, 40,10);
   GUI_DispStringHCenterAt(UTF8_speedadds, 55,15); //+速度 Fuselage0
   GUI_DispStringHCenterAt(UTF8_speedreduces, 55,100); // 基本速度Fuselage3
   GUI_DispStringHCenterAt(UTF8_Heightadds, 380,100); //材料高度Fuselage2
   GUI_DispStringHCenterAt(UTF8_Diameteradds, 380,15); //线径 Fuselage1
   
   
  default:
    WM_DefaultProc(pMsg);
    break;
  }
}
/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       CreateRGBLED
*/
void FUN_ICON5Clicked(void)
{
  
  WM_HWIN hWin;
  //
  /* I2C 外设初(AT24C02)始化 */第一代STM32F429至尊板是在这里初始化OK可以的,数据保存后步进电机跑也可以的
OS_INFO("Joint4DLG create\n");
  hWin=GUI_CreateDialogBox(_aDialogCreateRGBLED, GUI_COUNTOF(_aDialogCreateRGBLED), _cbDialogRGBLED, HDTWIN, 0, 0);
  while(Flag_ICON5)
{
     
    if(tpad_flag)WM_DeleteWindow(hWin);     
  GUI_Delay(10);     
}

}

回复

使用道具 举报

发表于 2018-3-17 11:08:48 | 显示全部楼层
调试看看程序是停止在哪里
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-3-17 12:48:11 | 显示全部楼层
调试程序正常,就是下载打开进入I2C写入数据时产生死机的
写W25Q128也同样是这样系统emWin窗口数据保存产生死机
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-3-17 12:50:38 | 显示全部楼层
都是按新板例子移殖的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-3-17 13:07:00 | 显示全部楼层
刚在调试出现停止在这  */
void I2C_EE_WaitEepromStandbyState(void)      
{
  vu16 SR1_Tmp = 0;

  do
  {
    /* Send START condition */
    I2C_GenerateSTART(EEPROM_I2C, ENABLE);
    /* Read EEPROM_I2C SR1 register */
    SR1_Tmp = I2C_ReadRegister(EEPROM_I2C, I2C_Register_SR1);
    /* Send EEPROM address for write */
    I2C_Send7bitAddress(EEPROM_I2C, EEPROM_ADDRESS, I2C_Direction_Transmitter);
  }while(!(I2C_ReadRegister(EEPROM_I2C, I2C_Register_SR1) & 0x0002));
  
  /* Clear AF flag */
  I2C_ClearFlag(EEPROM_I2C, I2C_FLAG_AF);
  /* STOP condition */   
  I2C_GenerateSTOP(EEPROM_I2C, ENABLE);
}
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-3-17 13:35:09 | 显示全部楼层
  调试看看程序是停止在  OSIdleTaskCtr++;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-3-17 15:27:08 | 显示全部楼层
随风 发表于 2018-3-17 11:08
调试看看程序是停止在哪里

楼上好,这个问实属火哥原创有关,刚在开机综合程序的RGB&AD转换例子中加入IIC保存也出现同样的问题
望反映情况协解决。谢天谢地,谢谢了
回复 支持 反对

使用道具 举报

发表于 2018-3-17 16:46:35 | 显示全部楼层
事急心缓 发表于 2018-3-17 15:27
楼上好,这个问实属火哥原创有关,刚在开机综合程序的RGB&AD转换例子中加入IIC保存也出现同样的问题
望 ...

核心板不带EEPROM,存储到EEPROM会有问题哦
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-3-17 22:17:11 | 显示全部楼层
已解决,系IIC24C02接线问题,数据线不按标示连接而是交叉接上就OK了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-11-23 12:12 , Processed in 0.034041 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表