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

📄 test-1.i

📁 This fat 16 can be used for logging function. The user can use it for logger device.
💻 I
📖 第 1 页 / 共 5 页
字号:
**      all damages exceed the amount of fifty dollars ($50.00).
**
** **UNDER NO CIRCUMSTANCES, INCLUDING NEGLIGENCE, WILL PRIIO BE LIABLE FOR 
** ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE, OR CONSEQUENTIAL DAMAGES, 
** INCLUDING LOST DATA, LOST REVENUE, OR LOST PROFITS, ARISING OUT OF OR 
** RELATING TO THIS LICENSE OR THE SOFTWARE.**
**
** SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSTION OR LIMITATION OF 
** CONSEQUENTIAL OR INDIRECT DAMAGES, SO THE ABOVE LIMITATION MAY NOT APPLY TO 
** YOU.
**
**  3.  License Grant.  Priio grants to you, and you accept, a personal, 
**      nonexclusive, nontransferable license to install and use the Software 
**      in source code format as a single site. You may not transfer, share or 
**      distribute the Software in any reusable form, without the express 
**      written permission of Priio. You may embed and deploy the executable 
**      forms of this Software with your product without royalty. You may make 
**      one copy of the Software in human-readable form for backup purposes 
**      only. The backup copy must include all copyright and license 
**      information contained on the original.  This License is effective 
**      until terminated as provided below.  You may terminate this License by 
**      destroying the Software and any copies of the Software in your 
**      possession.  This License will terminate automatically upon any 
**      violation of its terms by you or the Employer.  You acknowledge that 
**      this License does not entitle you to any support, maintenance, or 
**      upgrade from Priio.
**
**  4.  License Restrictions. You may not do any of the following yourself, or 
**      through any third party, and you may not permit any third party with 
**      whom you have a business relationship to do any of the following: (A) 
**      copy the Software, except as expressly set forth in paragraph 3 above;  
**      (B) sell, license, sublicense, lease, or rent, to any third party, 
**      whether for profit or without charge, any portion of the Software, or, 
**      in particular, without limiting the generality of the foregoing, 
**      distribute the Software on any media; make the Software accessible to 
**      the public or third parties, whether over networks, electronic 
**      bulletin boards, website, or otherwise; or allow any third to use the 
**      Software except for purpose of your internal business; (C) publish or 
**      otherwise communicate any review of or information about the 
**      performance of the Software to any third party without the prior 
**      written consent of Priio; (D) export, re-export, download, or 
**      otherwise use the Software in violation of any laws or regulations, 
**      including U.S. Department of Commerce Export Administration 
**      regulations and other applicable laws; or (E) use the Software in 
**      connection with life support systems, human implantation, medical 
**      devices, nuclear facilities, nuclear systems or weapons, aviation, 
**      mass transit, or any application where failure or malfunction could 
**      lead to possible loss of life or catastrophic property damage.
**
**  5.  Title and Ownership.  This software is protected by United State 
**      Patent, Copyright Law and International Treaty provisions.  Except for 
**      the rights expressly granted above, this License transfers to you no 
**      right, title, or interest in the Software, or any copyright, patent, 
**      trademark, trade secret, or other intellectual property or proprietary 
**      right in the Software.  Priio retains sole and exclusive title to all 
**      portions of the Software and any copies thereof, and you hereby assign 
**      to Priio all right, title and interest in and to any modifications you 
**      make to the Software, whether or not such modifications are permitted.  
**      You agree not to disclose the Software to anyone.
**
**  6.  Export Law Assurances.  You may not export, re-export, download, or 
**      otherwise use the Software except as authorized by United States law 
**      and the laws of the jurisdiction in which it is obtained.
**
**  7.  Notice to Government End Users.  The Software, including any 
**      documentation, is provided to the United States Government with 
**      restricted rights.  If the Software is supplied to the United State 
**      Government, the software is classified as "restricted computer 
**      software" as defined in clause 52.227-19 of the FAR.  The United 
**      States Government?s rights to the Software are as provided in clause 
**      52.227-19 if the FAR.
**
**  8.  Controlling Law and Severability.  This License will be governed by 
**      the laws of the United States and the State of Indiana without regard 
**      to their provisions regarding conflicts of laws.  This License will 
**      not be governed by the United Nations Convention on Contracts for the 
**      International Sale of Goods, the application of which is expressly 
**      excluded.  You irrevocably submit to the jurisdiction of the state and 
**      federal courts sitting in Indiana, and any action or proceeding 
**      arising out of this License will be heard and determined in such 
**      courts.  If for any reason a court of competent jurisdiction finds any 
**      provision, or portion thereof, to be unenforceable, such provision 
**      will be interpreted in order to give effect to such provision to the 
**      maximum extent permitted by law, and the remainder of this License 
**      will continue in full force and effect.  
**
**  9.  Complete Agreement.  This License constitutes the entire agreement 
**      between the parties with respect to the use of the Software and 
**      supersedes all prior or contemporaneous understandings regarding such 
**      subject matter.  No amendment to or modification of this License will 
**      be binding unless in writing and signed by Priio.
**
** BY SELECTING THE "I ACCEPT THE AGREEMENT" OPTION AND CLICKING ON THE "NEXT" 
** BUTTON, OR BY INSTALLING, COPYING, RUNNING, OR OTHERWISE USING THE PRIIO 
** SOFTWARE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE AGREEMENT.  IF 
** YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE AGREEMENT, PLEASE CLICK THE 
** "CANCEL" BUTTON, AND DO NOT INSTALL, RUN, COPY, OR OTHERWISE USE THE PRIIO 
** SOFTWARE.  
**
******************************************************************************
**
**  VERSION HISTORY:
**  ----------------
**  Version:    3.0 
**  Date:       March 29, 2006
**  Revised by: Erick M. Higa
**  Description:
**      - See "FILE_SYS.C" file for any chages up to this point.
**
*****************************************************************************/

/*****************************************************************************
**
**    MODULES USED 
**
*****************************************************************************/

/*****************************************************************************
**
**    DEFINITIONS AND MACROS
**
*****************************************************************************/
        

            
enum {NO_ERR=0, INIT_ERR, FILE_ERR, WRITE_ERR, READ_ERR, NAME_ERR, READONLY_ERR,
    SOF_ERR, EOF_ERR, ALLOC_ERR, POS_ERR, MODE_ERR, FAT_ERR, DISK_FULL,
        PATH_ERR, NO_ENTRY_AVAL, EXIST_ERR, INV_BOOTSEC_ERR, INV_PARTTABLE_ERR, 
            INV_PARTENTRY_ERR};
enum {CLOSED = 0, READ, WRITE, APPEND};
enum {SCAN_DIR_R, SCAN_DIR_W, SCAN_FILE_R, SCAN_FILE_W};
enum {CHAIN_R, CHAIN_W, SINGLE, START_CHAIN, END_CHAIN};
enum {SEEK_CUR, SEEK_END, SEEK_SET};

                                                        /*#define _DEBUG_FPUTC_*/
    
        
/****************************************************************************
**
**    TYPEDEFS AND STRUCTURES
**
****************************************************************************/


/* 32 byte structure */
typedef struct
{
    char name_entry[11];
    unsigned char attr;
    unsigned char reserved;
    unsigned char crt_tenth_sec;
            unsigned int crt_time;
        unsigned int crt_date;
        unsigned int acc_date;
        unsigned int start_clus_hi;
        unsigned int mod_time;
        unsigned int mod_date;
        unsigned int start_clus_lo;
        unsigned long file_size;
                                                                        } FileDirEntryStruct;

/* 552 bytes (+4 overhead using malloc) ==>  556 bytes required per file opened */
typedef struct
{
    unsigned int clus_start;                  /* Starting cluster of open file */
    unsigned int clus_current;                /* Current cluster of open file */
    unsigned int clus_next;                   /* Next (reading) cluster of open file */
    unsigned int clus_prev;                   /* Previous cluster of open file */
    unsigned char sec_offset;                   /* Current sector withing current cluster */
    unsigned long entry_sec_addr;              /* Sector address of File entry of open file */
    FileDirEntryStruct *file_dep;       /* Entry Pointer to the offset of the File Info */
            unsigned char buff[512];                /* Open file read/write buffer */
        unsigned long length;                      /* Length of file */
    unsigned long position;                    /* Current position in file relative to begining */
    unsigned char mode;                         /* 0=>closed, 1=>open for read, 2=>open for write, 3=> open for append */
    unsigned char error;                        /* Error indicator */
    unsigned char EOF_flag;                     /* End of File Flag */
    unsigned char *pntr;                        /* Pointer for file data use */
            unsigned char used_flag;                /* Flag to see if the file is used or not */
    } FileStruct;


/****************************************************************************
** 
**    EXPORTED VARIABLES
**
****************************************************************************/
    extern flash char _FF_VERSION_[];
                                            extern FileStruct _FF_FileSpaceAllocation[1];
    

/****************************************************************************
**
**    EXPORTED FUNCTIONS
**
****************************************************************************/
char ascii_to_char(char ascii_char);
char valid_file_char(char file_char);
    void read_directory(void);
            void dump_file_data_hex(FileStruct *rp);
        void dump_file_data_view(FileStruct *rp);
        void dump_buff_data_hex(void);
    void dump_file_entry_hex(FileDirEntryStruct *dep);
void GetVolID(void);

    int fquickformat(void);
    FileStruct *fcreate(char *fname, unsigned char fmode);
    int remove(char *fname);
    int rename(char *name_old, char *name_new);
            int mkdir(char *f_path);
        int rmdir(char *f_path);
        int ungetc(unsigned char file_data, FileStruct *rp);
    int fwrite(void *wr_buff, int dat_size, int num_items, FileStruct *rp);
    int fputs(char *file_data, FileStruct *rp);
            FileStruct *fcreatec(flash char *fname, unsigned char fmode);
        int removec(flash char *fname);
        int fputsc(flash char *file_data, FileStruct *rp);
        void fprintf(FileStruct *rp, flash char *pstr, ...);
                                            int fputc_(unsigned char file_data, FileStruct *rp);
    int fflush(FileStruct *rp);
    FileStruct *fopenc(flash char *fname, unsigned char MODEC);
    FileStruct *fopen(char *fname, unsigned char fmode);
int fclose(FileStruct *rp);
int ffreemem(FileStruct *rp);
            int chdirc(flash char *f_path);
                    int chdir(char *f_path);
    char _FF_chdir(char *f_path);
int fget_file_info(char *fname, unsigned long *fsize, char *create_date,
    char *mod_date, unsigned char *attribute, unsigned int *fclus);
    int fget_file_infoc(flash char *fname, unsigned long *fsize, char *create_date,
        char *mod_date, unsigned char *attribute, unsigned int *fclus);
            int fgetc_(FileStruct *rp);
int fread(void *rd_buff, int dat_size, int num_items, FileStruct *rp);
char *fgets(char *buffer, int n, FileStruct *rp);
int fend(FileStruct *rp);
int fseek(FileStruct *rp, long off_set, unsigned char fmode);
unsigned long ftell(FileStruct *rp);
int feof(FileStruct *rp);

            int fstream_filec(flash char *fname, unsigned long fsize);
                    int fstream_file(char *fname, unsigned long fsize);

/****************************************************************************
**
**    EOF 
**
****************************************************************************/
    
    /***************************** C SOURCE FILE ********************************
**
**  Project:    FlashFile
**  Filename:   SD_CMD.C 
**  Version:    3.0.1 
**  Date:       April 7, 2006
**  
*****************************************************************************
**
** Source Code Solution Software
** License Agreement
**
** IMPORTANT:  READ THIS AGREEMENT CAREFULLY. 
**
** BY SELECTING THE "I ACCEPT THE AGREEMENT" OPTION AND CLICKING ON THE "NEXT" 
** BUTTON, OR BY INSTALLING, COPYING, RUNNING, OR OTHERWISE USING THE PRIIO 
** SOFTWARE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE AGREEMENT.  IF 
** YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE AGREEMENT, PLEASE CLICK THE 
** "CANCEL" BUTTON, AND DO NOT INSTALL, RUN, COPY, OR OTHERWISE USE THE PRIIO 
** SOFTWARE.  
**
** This End User License Agreement ("License") is a legal agreement between 
** you and Progressive Resources LLC DBA Priio, 4105 Vincennes Road, 
** Indianapolis, IN 46268, USA ("Priio") concerning your use of the Priio 
** Software, together with any electronic documentation that may be provided 
** therewith (collectively, "the software") through the Software.  YOU HEREBY 

⌨️ 快捷键说明

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