Showing
7 changed files
with
26 additions
and
18 deletions
| ... | ... | @@ -75,7 +75,8 @@ void GlobalInitialize() |
| 75 | 75 | PathRemoveFileSpec(g_appdata.FolderPath); |
| 76 | 76 | else |
| 77 | 77 | GetCurrentDirectory(MAX_PATH, g_appdata.FolderPath); |
| 78 | - strcat(g_appdata.FolderPath,TOPWELL_TEMPBIN_DIR); | |
| 78 | + //strcat(g_appdata.FolderPath,TOPWELL_TEMPBIN_DIR); | |
| 79 | + sprintf(g_appdata.FolderPath,"%s%s%d",g_appdata.FolderPath,TOPWELL_TEMPBIN_DIR,GetTickCount()); | |
| 79 | 80 | if (FALSE==(BOOL)PathFileExists(g_appdata.FolderPath)) //最后的\\号有无都没关系 |
| 80 | 81 | CreateDirectory(g_appdata.FolderPath, NULL); |
| 81 | 82 | ... | ... |
| ... | ... | @@ -835,7 +835,7 @@ BOOL ResizeAllWindow(DWORD mainwidth, WORD mainheigh) |
| 835 | 835 | rect_setting.right = mainwidth; |
| 836 | 836 | rect_setting.bottom = SETTINGSFACTOR*gwBaseY; |
| 837 | 837 | |
| 838 | - rect_info.left = mainwidth*2/3; | |
| 838 | + rect_info.left = mainwidth/5; | |
| 839 | 839 | rect_info.top = rect_setting.bottom; |
| 840 | 840 | rect_info.right = mainwidth; |
| 841 | 841 | rect_info.bottom = mainheigh; | ... | ... |
| ... | ... | @@ -316,7 +316,7 @@ void ReceiveFileText( LPCTSTR ); |
| 316 | 316 | // Buffer manipulation functions |
| 317 | 317 | // |
| 318 | 318 | void OutputABufferToWindow( HWND, char *, DWORD ); |
| 319 | -void OutputABuffer( HWND, char *, DWORD ); | |
| 319 | +void OutputABuffer( HWND, char * ); | |
| 320 | 320 | BOOL ClearTTYContents( void ); |
| 321 | 321 | |
| 322 | 322 | // | ... | ... |
| ... | ... | @@ -158,9 +158,9 @@ HISTORY: Date: Author: Comment: |
| 158 | 158 | 10/27/95 AllenD Wrote it |
| 159 | 159 | |
| 160 | 160 | -----------------------------------------------------------------------------*/ |
| 161 | -void OutputABuffer(HWND hTTY, char * lpBuf, DWORD dwBufLen) | |
| 161 | +void OutputABuffer(HWND hTTY, char * lpBuf) | |
| 162 | 162 | { |
| 163 | - dwBufLen = strlen(lpBuf); | |
| 163 | + DWORD dwBufLen =strlen(lpBuf); | |
| 164 | 164 | if (dwBufLen == 0) { |
| 165 | 165 | OutputDebugString("NULL Buffer in OutputABuffer\n\r"); |
| 166 | 166 | return; | ... | ... |
| ... | ... | @@ -117,7 +117,7 @@ DWORD WINAPI ReaderAndStatusProc(LPVOID lpV) |
| 117 | 117 | |
| 118 | 118 | if (dwRead) |
| 119 | 119 | { |
| 120 | - OutputABuffer(hTTY, lpBuf, dwRead); | |
| 120 | + OutputABuffer(hTTY, lpBuf); | |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | } |
| ... | ... | @@ -198,7 +198,7 @@ DWORD WINAPI ReaderAndStatusProc(LPVOID lpV) |
| 198 | 198 | return 0; |
| 199 | 199 | } |
| 200 | 200 | g_appdata.rgbBGColor = RGB(255, 255, 255); |
| 201 | - OutputABuffer(hTTY, "进入下载模式\r\n", dwRead); | |
| 201 | + OutputABuffer(hTTY, "进入下载模式\r\n"); | |
| 202 | 202 | g_appdata.DownloadReday = TRUE; |
| 203 | 203 | if (strlen(g_appdata.szFileName) != 0) |
| 204 | 204 | TransferFileTextStart(g_appdata.szFileName); |
| ... | ... | @@ -207,7 +207,7 @@ DWORD WINAPI ReaderAndStatusProc(LPVOID lpV) |
| 207 | 207 | { |
| 208 | 208 | g_appdata.tickcountFinish = GetTickCount(); |
| 209 | 209 | g_appdata.rgbBGColor = RGB(50, 255, 50); |
| 210 | - OutputABuffer(hTTY, "下载完成\r\n", dwRead); | |
| 210 | + OutputABuffer(hTTY, "下载完成\r\n"); | |
| 211 | 211 | g_appdata.DownloadReday = FALSE; |
| 212 | 212 | } |
| 213 | 213 | else if (strstr(lpBuf, "Programming:")) |
| ... | ... | @@ -222,7 +222,7 @@ DWORD WINAPI ReaderAndStatusProc(LPVOID lpV) |
| 222 | 222 | strncpy(ascbufpercent, pchar_percent + 12, 2); |
| 223 | 223 | Flashed_percent = atoi(ascbufpercent); |
| 224 | 224 | sprintf(ascbufpercent, "下载已完成%d\r\n", Flashed_percent); |
| 225 | - OutputABuffer(hTTY, ascbufpercent, dwRead); | |
| 225 | + OutputABuffer(hTTY, ascbufpercent); | |
| 226 | 226 | g_appdata.DownloadReday = FALSE; |
| 227 | 227 | } |
| 228 | 228 | } |
| ... | ... | @@ -230,13 +230,13 @@ DWORD WINAPI ReaderAndStatusProc(LPVOID lpV) |
| 230 | 230 | { |
| 231 | 231 | //g_appdata.tickcountFinish = GetTickCount(); |
| 232 | 232 | g_appdata.rgbBGColor = RGB(255, 50, 50); |
| 233 | - OutputABuffer(hTTY, "下载失败\r\n", dwRead); | |
| 233 | + OutputABuffer(hTTY, "下载失败\r\n"); | |
| 234 | 234 | g_appdata.DownloadReday = FALSE; |
| 235 | 235 | } |
| 236 | 236 | else |
| 237 | 237 | { |
| 238 | 238 | g_appdata.rgbBGColor = RGB(255, 255, 255); |
| 239 | - OutputABuffer(hTTY, lpBuf, dwRead); | |
| 239 | + OutputABuffer(hTTY, lpBuf); | |
| 240 | 240 | g_appdata.DownloadReday = FALSE; |
| 241 | 241 | } |
| 242 | 242 | } | ... | ... |
| ... | ... | @@ -597,7 +597,7 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 597 | 597 | } |
| 598 | 598 | if (g_appdata.DownloadReday == FALSE) |
| 599 | 599 | { |
| 600 | - MessageBox(ghwndMain, "请合上夹具", "提示!", MB_OK); | |
| 600 | + //MessageBox(ghwndMain, "请合上夹具", "提示!", MB_OK); | |
| 601 | 601 | return FALSE; |
| 602 | 602 | } |
| 603 | 603 | |
| ... | ... | @@ -611,6 +611,12 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 611 | 611 | { |
| 612 | 612 | ChangeConnection(hWndDlg, g_appdata.fConnected); |
| 613 | 613 | SetWindowText(GetDlgItem(hWndDlg, IDC_BUTTON_CONNECT_UART), "断开夹具"); |
| 614 | + g_appdata.rgbBGColor = RGB(255, 255, 255); | |
| 615 | + OutputABuffer(ghWndTTY, "成功连接夹具 \n\r"); | |
| 616 | + if (strcmp(g_appdata.szFileName,"") == 0) | |
| 617 | + OutputABuffer(ghWndTTY, "尚未设定软件路径 \n\r"); | |
| 618 | + else | |
| 619 | + OutputABuffer(ghWndTTY, "软件已设定, 请下压夹具开始\n\r"); | |
| 614 | 620 | } |
| 615 | 621 | } |
| 616 | 622 | else |
| ... | ... | @@ -619,6 +625,9 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 619 | 625 | { |
| 620 | 626 | ChangeConnection(hWndDlg, g_appdata.fConnected); |
| 621 | 627 | SetWindowText(GetDlgItem(hWndDlg, IDC_BUTTON_CONNECT_UART), "连接夹具"); |
| 628 | + g_appdata.rgbBGColor = RGB(255, 201, 14); | |
| 629 | + OutputABuffer(ghWndTTY, "夹具已断开, 请重新连接夹具\n\r"); | |
| 630 | + | |
| 622 | 631 | } |
| 623 | 632 | |
| 624 | 633 | } | ... | ... |
| ... | ... | @@ -658,16 +658,15 @@ const char dft_bdaddr[6] = { 0x00,0x00,0x00,0x3F,0x9f,0x94 }; |
| 658 | 658 | |
| 659 | 659 | char macid_sub[3] = {0x9e, 0x8b, 0x0}; |
| 660 | 660 | |
| 661 | -//int macid_company = 1; | |
| 661 | +char macid_company[3] = {0x0, 0x1, 0x2}; | |
| 662 | 662 | |
| 663 | 663 | |
| 664 | 664 | |
| 665 | 665 | //char *fData, |
| 666 | -int fileCheck_fix_MACID( const char macid_sub[3]) | |
| 666 | +int fileCheck_fix_MACID( const char macid_sub[3],const char macid_company[3]) | |
| 667 | 667 | { |
| 668 | 668 | int i; |
| 669 | 669 | int ret = FILE_CHCK_SUCCESSFUL; |
| 670 | - int macid_company = GetTickCount(); | |
| 671 | 670 | char tempBinFileName[256]; |
| 672 | 671 | DWORD dwWritten; |
| 673 | 672 | char *p = g_appdata.BufEarphoneBin + MAC_ADDR_OFFSET + BAUDRATE_DET_DATA_LEN + HEADER_LEN; |
| ... | ... | @@ -682,8 +681,7 @@ int fileCheck_fix_MACID( const char macid_sub[3]) |
| 682 | 681 | } |
| 683 | 682 | |
| 684 | 683 | memcpy(baaddr, macid_sub, sizeof(macid_sub)); |
| 685 | - //macid_company = macid_company<<8; | |
| 686 | - memcpy(baaddr +3, &macid_company,3); | |
| 684 | + memcpy(baaddr + (sizeof(macid_sub)), macid_company, sizeof(macid_company)); | |
| 687 | 685 | |
| 688 | 686 | //memset(baaddr,0,sizeof(baaddr)); |
| 689 | 687 | //app_lcd_device.display_char (" ", 0, 0); |
| ... | ... | @@ -893,7 +891,7 @@ DWORD WINAPI TransferThreadProc(LPVOID lpV) |
| 893 | 891 | /**********************check file*********************************/ |
| 894 | 892 | //lpfileBuf = HeapAlloc(hDataHeap, 0, dwFileSize); |
| 895 | 893 | pRead = g_appdata.BufEarphoneBin; |
| 896 | - err = fileCheck_fix_MACID(macid_sub); | |
| 894 | + err = fileCheck_fix_MACID(macid_sub,macid_company); | |
| 897 | 895 | if (err == WRONG_FILE_FORMAT) |
| 898 | 896 | { |
| 899 | 897 | ErrorReporter("wrong file format!"); | ... | ... |
Please
register
or
login
to post a comment