/***********************************************************************
2005.1.3
1. 将UsbDNCFlg的赋值放在DNC命令188回应后
2005.04.07
1.u盘文件存入系统,增加过滤非法字符和小写转大写
2005年4月17日
1. 选中u盘文件后按ENTER键提示选择操作类型
2. RunUsbManage 进来未检测到u盘只返回-1,不再强制返回PRGRM
2005.04.22
1.增加U盘删除文件的功能
2.删除原来进入文件夹的功能
3.更改检测U盘是否拔掉的方法
2005.5.28
1. 在移除u盘函数中增加复位u盘的功能
2005.8.10
1.增加切入u盘界面时的图形模拟处理
修 改 人:杨辉
修改记录:
2006.7.8 与ShowUserFile ReadFile LoadFRTable相关的部分
2006.7.22 CopyFileFlashToUsb(UCHAR *pDesName,UCHAR *pSrcName),修改拷贝最后一块时大小
length = tCurrFile.size; -> length = tCurrFile.size - sum;
*************************************************************************/
#include "cpu_lib.h"
#include "lib.h"
#include "keyboard.h"
#include "editor.h"
#include "usbmanage.h"
#include "HPI.h"
#include "sl811.h"
#include "FmData.h"
#include "Alert.h"
#include "simu.h"
#include "start.h"
#include "washing256.h"
#include "filemanage.h"
//===========================================================================
extern Rect_t RectFileManage;
#define UFStartX FMCOL1+FMMARGEWIDTH
#define UFStartY RectFileManage.y1+4
//=============================================================================
#define SUBDIR 0x10
//=================================================================================
//功能键定义
#define SAVTOSYS F1
#define BRWSYS F2
#define SYSPAGEDOWN F3
#define REMOVEUSB F4
#define SAVTOU F1
#define BRWUSB F2
#define DELFILE F3
#define USBDNC F4
#define ALLSYSTOUSB F4 //对于车床是必要的
#if MACHTYPE == WATERJET
#define DNCSTRT WLPSTART
#else
#define DNCSTRT LPSTART
#endif
//===================================================================================
#define UMsgX1 AlertStatusX+4
#define UMsgY1 AlertStatusY + 2
#define UMsgX2 AlertStatusW + 315
#define UMsgY2 AlertStatusY + 18
#define UStatX1 0
#define UStatY1 395
#define UStatX2 320
#define UStatY2 414
//===================================================================================
#define UDirMaxLev 6
//===================================================================================
//extern UCHAR bmpWashing[];
extern Rect_t InputBoxRect;
//extern T_FileRegTable tCurrFile;
extern UCHAR g_ucShowUserFileCount;
extern UCHAR g_ucFileCount;
extern UCHAR OpCoorChgFlg;
extern const UCHAR *FMErr[30];
extern const UCHAR *FMMsg[40];
//=====================================================================================
extern FILE_INFO ThisFile;
extern U8 DIRBUF[8192];
extern U8 INOUTBUF[INOUTBUF_LENGTH];
extern UCHAR OpAxisSet;
XXGFLAGS bXXGFlags;
//=================================================================================
extern void PaintFileManageWindow(void);
//extern void ShowUserFile(UCHAR ucStartFile);
//extern INT32 ReadFile(UCHAR *pName, UCHAR *desBuff,INT32 size);
//extern INT32 OpenFile(UCHAR *pcName,T_FileRegTable *tCurr);
extern INT32 GetFileName(UCHAR *Buff);
extern INT32 WriteFile(UCHAR *pName, UCHAR *srcBuff,INT32 size);
extern INT32 FileNameIsExist(UCHAR *pcName);
extern void LoadFRTable(void);
extern void DrawButtonDown(Button_t *Btn);
extern void ResetUsb(void);
//==================================================================================
U16 CalTimePara4FAT(U8 hour,U8 minute,U8 second);
U16 CalDatePara4FAT(U16 year,U8 month,U8 day);
//=================================================================================
void ShowUsbManageWindow(void);
void PaintUsbManageButton(Button_t *BtnBottom);
void PaintUsbManageTitle(void);
void PaintUsbManageStatus(void);
void PaintUsbFileWindow(void);
void ClearUsbFileWindow(void);
void RemoveUsb(void);
void ShowInputWin(UCHAR *);
void HideInputWin(void);
INT32 CopyFileFlashToUsb(UCHAR *pDesName,UCHAR *pSrcName);
INT32 ShowUsbFile(UINT16);
void BigCursorXY(INT16 wNewY);
void ShowBigCursor(void);
INT32 ShowNewFileList(void);
void UsbInit(void);
int UsbFileList(void);
void ShowUsbCurrDirFile(INT32 startfile);
INT32 DelUsbFile(UCHAR *pFileName,UCHAR attr);
INT32 CopyFileUsbToFlash(CHAR *DesName,CHAR *SrcName);
void GetCurrItemNameAttr(INT16 num,UCHAR *pName,UCHAR *pAttr);
INT32 OpenCurrDir(UCHAR *pDirName);
void TransUsbDirName(CHAR * pDesName, CHAR *pSrcName);
void HideUsbDir(void);
void ShowUsbDir(UCHAR Lev);
void SortCurrDir(UINT16 MaxItem);
void ClrDncMsg(void);
void ShowDncMsg(void);
INT32 RunUsbDNC(UCHAR *NameBuff);
void InitInterface(void);
INT32 CopyFileUsbToVRam(CHAR *pSrcName,INT32* pOverFlag);
//===============================================================================
UINT16 g_sUsbFileNum = 0;
INT32 UsbDNCFlg = 0;
//===============================================================================
Button_t *UsbBtnBottom;
static Button_t UsbBtnBottomMill[10] =
{
{2 + (ButtonWidth + 4) * 0, BottomButtonY, ButtonWidth, ButtonHeight, strUSBUTS, BS_UP},
{2 + (ButtonWidth + 4) * 1, BottomButtonY, ButtonWidth, ButtonHeight, strUSBPGU, BS_UP},
{2 + (ButtonWidth + 4) * 2, BottomButtonY, ButtonWidth, ButtonHeight, strUSBPGD, BS_UP},
{2 + (ButtonWidth + 4) * 3, BottomButtonY, ButtonWidth, ButtonHeight, strUSBREV, BS_UP},
{2 + (ButtonWidth + 4) * 4, BottomButtonY, ButtonWidth, ButtonHeight, strSHFTKY, BS_UP},
{2 + (ButtonWidth + 4) * 0, BottomButtonY, ButtonWidth, ButtonHeight, strUSBSTU, BS_UP},
{2 + (ButtonWidth + 4) * 1, BottomButtonY, ButtonWidth, ButtonHeight, strUSBCDU, BS_UP},
{2 + (ButtonWidth + 4) * 2, BottomButtonY, ButtonWidth, ButtonHeight, strUSBDUP, BS_UP},
{2 + (ButtonWidth + 4) * 3, BottomButtonY, ButtonWidth, ButtonHeight, strUSBDNC, BS_UP},
{2 + (ButtonWidth + 4) * 4, BottomButtonY, ButtonWidth, ButtonHeight, strSHFTKY, BS_UP}
};
static Button_t UsbBtnBottomLathe[10] =
{
{0 + (ButtonWidth + 5) * 0, BottomButtonY, ButtonWidth, ButtonHeight, strUSBUTS, BS_UP},
{0 + (ButtonWidth + 5) * 1, BottomButtonY, ButtonWidth, ButtonHeight, strUSBPGU, BS_UP},
{0 + (ButtonWidth + 5) * 2, BottomButtonY, ButtonWidth, ButtonHeight, strUSBPGD, BS_UP},
{0 + (ButtonWidth + 5) * 3, BottomButtonY, ButtonWidth, ButtonHeight, strUSBREV, BS_UP},
{0 + (ButtonWidth + 5) * 4, BottomButtonY, ButtonWidth, ButtonHeight, strSHFTKY, BS_UP},
{0 + (ButtonWidth + 5) * 0, BottomButtonY, ButtonWidth, ButtonHeight, strUSBSTU, BS_UP},
{0 + (ButtonWidth + 5) * 1, BottomButtonY, ButtonWidth, ButtonHeight, strUSBCDU, BS_UP},
{0 + (ButtonWidth + 5) * 2, BottomButtonY, ButtonWidth, ButtonHeight, strUSBDUP, BS_UP},
{0 + (ButtonWidth + 5) * 3, BottomButtonY, ButtonWidth, ButtonHeight, strUSBALL, BS_UP},
{0 + (ButtonWidth + 5) * 4, BottomButtonY, ButtonWidth, ButtonHeight, strSHFTKY, BS_UP}
};
static TitleBar_t UsbTitle = { TitleX, TitleY, TitleW, TitleH, strUSBTlt, 0, BX_RAISED};
static StatusBar_t UsbStatusBar[3] =
{
{AlertStatusX, AlertStatusY, AlertStatusW, AlertStatusH, " ", 3 , BX_INSET}, //报警栏
{6 + AlertStatusW , AlertStatusY, 313, AlertStatusH, " ", 3 , BX_INSET}, //状态栏
{6 + AlertStatusW , AlertStatusY-27, 313, AlertStatusH," ", 3 ,BX_INSET}
};
static Rect_t RectUsbFileManage = { USBPROGSTARTX,USBPROGSTARTY, USBPROGENDX,USBPROGENDY };
static Cursor_t BigCursor;
static BOOL UErrFlg = 0;
UCHAR DirStr[UDirMaxLev][13] = {{"U:"},{" "},{" "},{" "},{" "},{" "}}; //8级目录
static UCHAR UsbFileNameBuff[11];
static INT32 sDirLev;
//===============================================================================
void ShowUserFileInUSBFace(FS_FileInfo *pInfo, UCHAR ucStartFile)
{
UCHAR i,j,Max;
UCHAR Buff[10];
UINT16 x,y;
COLOR SavPen,SavBrush;
SavPen = GetPen();
SavBrush = GetBrush();
SetBrush(TXTFORECOLOR);
DrawTextBox(RectFileMa
没有合适的资源?快使用搜索试试~ 我知道了~
USB-host.zip_SL811HS
共32个文件
c:13个
h:13个
s:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 41 浏览量
2022-09-14
20:20:35
上传
评论
收藏 67KB ZIP 举报
温馨提示
使用SL811HS实现的能应用于ARM 44B0的USB主机程序
资源推荐
资源详情
资源评论
收起资源包目录
USB-host.zip (32个子文件)
RTC.c 2KB
RTC.h 1KB
usb.c 24KB
usbmanage.h 633B
start.h 706B
usbmanage.c 54KB
start.c 21KB
lib.h 2KB
lcd.c 6KB
main.c 4KB
cpu_addr.h 94B
MassOp.C 18KB
44b0core
44BLIB_A.S 2KB
44blib.c 10KB
44baddr.h 15KB
Option.s 490B
Option.h 776B
Memcfg.s 2KB
44binit.s 18KB
Cache.c 7KB
CACHE.H 115B
44blib.h 2KB
MassOp.h 659B
SL811.h 6KB
cpu_lib.c 41B
cpu_init.s 28B
cpu_lib.h 90B
usb.h 164B
cpu_slib.s 29B
SL811.C 24KB
lib.c 7KB
usbdemo.c 21KB
共 32 条
- 1
资源评论
御道御小黑
- 粉丝: 61
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功