⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 backup.c

📁 自动联想命令行处理代码
💻 C
字号:
#if !BASIC_BIOS

#include <stdio.h>
#include "bios.h"
#include "cli.h"
#include "rtc.h"
#include "uart.h"
#include "xmodem.h"

static CommandNode CLI_NAME_BACKUP =
{
    "backup",               // node command hint pointer
    "备份类",               // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_KEY,       // node type
    NULL                    // node command value
};

static CommandNode CLI_NAME_BACKUPTFTP =
{
    "tftp",                 // node command hint pointer
    "网口备份",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_IP,        // node type
    CLI_BACKUPTFTP          // node command value
};

static CommandNode CLI_NAME_BACKUPNAME =
{
    "filename",             // node command hint pointer
    "文件名称",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_STRING,    // node type
    NULL                    // node command value
};

static CommandNode CLI_NAME_BACKUPXMODEM =
{
    "xmodem",               // node command hint pointer
    "串口备份",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_KEY,       // node type
    CLI_BACKUPXMODEM        // node command value
};

static CommandNode CLI_NAME_BACKUPFROM =
{
    "from",                 // node command hint pointer
    "起始地址",         // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_HEX,       // node type
    NULL                    // node command value
};

static CommandNode CLI_NAME_BACKUPSIZE =
{
    "size",                 // node command hint pointer
    "数据大小",             // node command help pointer
    NULL,                   // node current input buffer pointer
    NULL,                   // down leaf pointer
    NULL,                   // right leaf pointer
    COMMAND_TYPE_HEX,       // node type
    NULL                    // node command value
};

CommandNode *CLI_BackupTftp[] =
{
    &CLI_NAME_BACKUP,    
    &CLI_NAME_BACKUPTFTP,      
    &CLI_NAME_BACKUPNAME,
    &CLI_NAME_BACKUPFROM,
    &CLI_NAME_BACKUPSIZE,
    NULL
};

CommandNode *CLI_BackupXmodem[] =
{
    &CLI_NAME_BACKUP,    
    &CLI_NAME_BACKUPXMODEM,      
    &CLI_NAME_BACKUPFROM,
    &CLI_NAME_BACKUPSIZE,
    NULL
};

void CLI_BackupProc( unsigned char key )
{
    switch( key )
    {
   	    case CLI_LOADECTENDXMODEM:
        	CLI_BackupXmodemProc();
        	break;

        case CLI_LOADEXTENDTFTP:
	        CLI_BackupTftpProc();
	        break;

        default:
            break;
    }
}

void CLI_BackupXmodemProc( void )
{
}

void CLI_BackupTftpProc( void )
{
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -