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

📄 ymodem.h

📁 ATmega103、ATmega128做的开发板web server源码
💻 H
字号:
/******************************************************************
* ymodem.h:
* 
* Copyright (c) 2001 Atmel Corporation.
* All Rights Reserved.
*
* You are autorized to use, copy and distribute this software only at 
* a single site (the term "site" meaning a single company location). 
* This copyright notice must be included in any copy, modification 
* or portion of this software merged into another program.
* 
* This software is licenced solely for use with Atmel AVR micro 
* controller family. The software may not be modified to execute on 
* any other microcontroller architectures
*
* This software is provided "as is"; Without warranties either express
* or implied, including any warranty regarding merchantability, 
* fitness for a particular purpose or noninfringement. 
*
* In no event shall Atmel or its suppliers be liable for any special, 
* indirect,incidential or concequential damages resulting from the 
* use or inability to use this software.
*
* Revision history:
*
* January 17, 2001:   Version 1.0   Created by JB
* July 13, 2001		  Version 1.2     JB
* 					- Changed to IAR compiler V2.25
*					- Renamed flash file functions to avoid conflict with 
*					  standard file I/O names	
*					- Bug fixes in HTTP
*					- Speed optimization in TCP 
*
*
*******************************************************************/

// ymodem receive utility header file

#define SOH   01
#define STX   02
#define EOT   04
#define ACK   06
#define NAK   0x15
#define CRCCHR 'C'
#define CAN   0x18

#define true  1
#define false 0

#define full  0xff
#define empty 0x00
 
#define bad   0x00
#define good  0x01
#define dup   0x02
#define end   0x03
#define err   0x04
#define out   0x05 
#define canc  0x06    

#define YMODEM_3SEC 53 //53 overflows on an 8-bit counter at 4.6Mhz/1024 = 3 sec
                
// function prototypes            
void initYmodem(void);
void purge(unsigned char temp);
void receive(char *bufptr1);
void sendc(void);
unsigned char validate_packet(char *bufptr,unsigned int size);
void recv_wait(void);
void respond(char packet);
unsigned int calcrc(char *ptr, int count);
void checkYmodem(void);
void get_ymodem(char *localPtr);
void check_ydata(char *ymodemBufptr, unsigned char *localPtr);



⌨️ 快捷键说明

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