虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

1对1直接输出

  • 设计一个彩灯控制器

    设计一个彩灯控制器,彩灯控制器的第1种花样为彩灯从右到左,然后从左到右逐次点亮,接着全灭全亮;第2种花样为彩灯两边同时亮1个,并逐次向中间移动再散开;第3种花样为彩灯两边同时亮2个逐次向中间移动再散开;第4种花样为彩灯两边同时亮3个,然后4亮4灭,4灭4亮,最后1灭1亮。4种花样自动变换,循环往复。

    标签: 彩灯控制器

    上传时间: 2014-01-22

    上传用户:guanliya

  • 基于51的温度采集系统

    DS18B20传感器采集温度,数字输出式传感器直接输出到单片机。

    标签: 51单片机 温度传感器 温度采集

    上传时间: 2015-04-19

    上传用户:byxzwz

  • c语言深度剖析

    第一章关键字...................................................................................................................................9 1.1,最宽恒大量的关键字----auto..........................................................................................11 1.2,最快的关键字---- register............................................................................................... 11 1.2.1,皇帝身边的小太监----寄存器............................................................................. 11 1.2.2,使用register 修饰符的注意点.............................................................................11 1.3,最名不符实的关键字----static........................................................................................12 1.3.1,修饰变量...............................................................................................................12 1.3.2,修饰函数...............................................................................................................13 1.4,基本数据类型----short、int、long、char、float、double........................................... 13 1.4.1,数据类型与“模子”............................................................................................... 14 1.4.2,变量的命名规则...................................................................................................14 1.5,最冤枉的关键字----sizeof...............................................................................................18 1.5.1,常年被人误认为函数...........................................................................................18 1.5.2,sizeof(int)*p 表示什么意思?........................................................................18 1.4,signed、unsigned 关键字................................................................................................19 1.6,if、else 组合.................................................................................................................... 20 1.6.1,bool 变量与“零值”进行比较...............................................................................20 1.6.2, float 变量与“零值”进行比较.................................................................................21 1.6.3,指针变量与“零值”进行比较...............................................................................21 1.6.4,else 到底与哪个if 配对呢?...............................................................................22 1.6.5,if 语句后面的分号............................................................................................... 23 1.6.6,使用if 语句的其他注意事项.............................................................................. 24 1.7,switch、case 组合........................................................................................................... 24 1.7.1,不要拿青龙偃月刀去削苹果.............................................................................. 24 1.7.2,case 关键字后面的值有什么要求吗?.............................................................. 25 1.7.3,case 语句的排列顺序...........................................................................................25 1.7.4,使用case 语句的其他注意事项..........................................................................27 1.8,do、while、for 关键字................................................................................................... 28 1.8.1,break 与continue 的区别.....................................................................................28 1.8.2,循环语句的注意点...............................................................................................29 1.9,goto 关键字......................................................................................................................30 1.10,void 关键字....................................................................................................................31 1.10.1,void a?............................................................................................................31 1.10,return 关键字................................................................................................................. 34 1.11,const 关键字也许该被替换为readolny....................................................................... 34 1.11.2,节省空间,避免不必要的内存分配,同时提高效率.................................... 35 1.12,最易变的关键字----volatile.......................................................................................... 36 1.13,最会带帽子的关键字----extern.................................................................................... 37 1.14,struct 关键字..................................................................................................................38

    标签: c语言深度剖析

    上传时间: 2015-05-01

    上传用户:cascas

  • net_tcp.h

    /* ********************************************************************************************************* *                                             uC/TCP-IP V2 *                                      The Embedded TCP/IP Suite * *                          (c) Copyright 2003-2010; Micrium, Inc.; Weston, FL * *               All rights reserved.  Protected by international copyright laws. * *               uC/TCP-IP is provided in source form to registered licensees ONLY.  It is  *               illegal to distribute this source code to any third party unless you receive  *               written permission by an authorized Micrium representative.  Knowledge of  *               the source code may NOT be used to develop a similar product. * *               Please help us continue to provide the Embedded community with the finest  *               software available.  Your honesty is greatly appreciated. * *               You can contact us at www.micrium.com. ********************************************************************************************************* */ /* ********************************************************************************************************* * *                                          NETWORK TCP LAYER *                                   (TRANSMISSION CONTROL PROTOCOL) * * Filename      : net_tcp.h * Version       : V2.10 * Programmer(s) : ITJ ********************************************************************************************************* * Note(s)       : (1) Supports Transmission Control Protocol as described in RFC #793 with the following *                     restrictions/constraints : * *                     (a) TCP Security & Precedence NOT supported               RFC # 793, Section 3.6 * *                     (b) TCP Urgent Data           NOT supported               RFC # 793, Section 3.7 *                                                                                'The Communication of *                                                                                  Urgent Information' * *                     (c) The following TCP options NOT supported :              * *                         (1) Window Scale                                      RFC #1072, Section 2 *                                                                               RFC #1323, Section 2 *                         (2) Selective Acknowledgement (SACK)                  RFC #1072, Section 3 *                                                                               RFC #2018 *                                                                               RFC #2883 *                         (3) TCP Echo                                          RFC #1072, Section 4 *                         (4) Timestamp                                         RFC #1323, Section 3.2 *                         (5) Protection Against Wrapped Sequences (PAWS)       RFC #1323, Section 4 * *                     (d) #### IP-Options-to-TCP-Connection                     RFC #1122, Section 4.2.3.8 *                                Handling NOT           supported * *                     (e) #### ICMP-Error-Message-to-TCP-Connection             RFC #1122, Section 4.2.3.9 *                                Handling NOT currently supported * *                 (2) TCP Layer assumes/requires Network Socket Layer (see 'net_sock.h  MODULE  Note #1a2'). ********************************************************************************************************* */ /*$PAGE*/ /* ********************************************************************************************************* *                                               MODULE * * Note(s) : (1) TCP Layer module is NOT required for UDP-to-Application API configuration. * *               See also 'net_cfg.h  TRANSPORT LAYER CONFIGURATION' *                      & 'net_cfg.h  USER DATAGRAM PROTOCOL LAYER CONFIGURATION'. * *               See also 'net_tcp.h  Note #2'. * *           (2) The following TCP-module-present configuration value MUST be pre-#define'd in  *               'net_cfg_net.h' PRIOR to all other network modules that require TCP Layer *               configuration (see 'net_cfg_net.h  TCP LAYER CONFIGURATION  Note #2b') : * *                   NET_TCP_MODULE_PRESENT ********************************************************************************************************* */ #ifdef   NET_TCP_MODULE_PRESENT                                 /* See Note #2.                                         */ /* ********************************************************************************************************* *                                               EXTERNS ********************************************************************************************************* */ #if ((defined(NET_TCP_MODULE)) && \      (defined(NET_GLOBALS_EXT))) #define  NET_TCP_EXT #else #define  NET_TCP_EXT  extern #endif /*$PAGE*/ /* ********************************************************************************************************* *                                               DEFINES ********************************************************************************************************* */ /* ********************************************************************************************************* *                                         TCP HEADER DEFINES * * Note(s) : (1) The following TCP value MUST be pre-#define'd in 'net_def.h' PRIOR to 'net_buf.h' so that *               the Network Buffer Module can configure maximum buffer header size (see 'net_def.h  TCP *               LAYER DEFINES' & 'net_buf.h  NETWORK BUFFER INDEX & SIZE DEFINES  Note #1') : * *               (a) NET_TCP_HDR_SIZE_MAX                  60        (NET_TCP_HDR_LEN_MAX *                                                                  * NET_TCP_HDR_LEN_WORD_SIZE) * *           (2) Urgent pointer & data NOT supported (see 'net_tcp.h  Note #1b'). ********************************************************************************************************* */ #define  NET_TCP_HDR_LEN_MASK                         0xF000u #define  NET_TCP_HDR_LEN_SHIFT                            12u #define  NET_TCP_HDR_LEN_NONE                              0u #define  NET_TCP_HDR_LEN_MIN                               5u #define  NET_TCP_HDR_LEN_MAX                              15u #define  NET_TCP_HDR_LEN_WORD_SIZE                       CPU_WORD_SIZE_32 #define  NET_TCP_HDR_SIZE_MIN                           (NET_TCP_HDR_LEN_MIN * NET_TCP_HDR_LEN_WORD_SIZE) #if 0                                                           /* See Note #1a.                                        */ #define  NET_TCP_HDR_SIZE_MAX                           (NET_TCP_HDR_LEN_MAX * NET_TCP_HDR_LEN_WORD_SIZE) #endif #define  NET_TCP_HDR_SIZE_TOT_MIN                       (NET_IP_HDR_SIZE_TOT_MIN + NET_TCP_HDR_SIZE_MIN) #define  NET_TCP_HDR_SIZE_TOT_MAX                       (NET_IP_HDR_SIZE_TOT_MAX + NET_TCP_HDR_SIZE_MAX) #define  NET_TCP_PSEUDO_HDR_SIZE                          12u   /*  = sizeof(NET_TCP_PSEUDO_HDR)                        */ #define  NET_TCP_PORT_NBR_RESERVED                       NET_PORT_NBR_RESERVED #define  NET_TCP_PORT_NBR_NONE                           NET_TCP_PORT_NBR_RESERVED #define  NET_TCP_HDR_URG_PTR_NONE                     0x0000u   /* See Note #2.                                         */ /*$PAGE*/ /* ********************************************************************************************************* *                                       TCP HEADER FLAG DEFINES * * Note(s) : (1) See 'TCP HEADER  Note #2' for flag fields. * *           (2) Urgent pointer & data NOT supported (see 'net_tcp.h  Note #1b'). ********************************************************************************************************* */ #define  NET_TCP_HDR_FLAG_MASK                        0x0FFFu #define  NET_TCP_HDR_FLAG_NONE                    DEF_BIT_NONE #define  NET_TCP_HDR_FLAG_RESERVED                    0x0FE0u   /* MUST be '0'.                                         */ #define  NET_TCP_HDR_FLAG_URGENT                  DEF_BIT_05    /* See Note #2.                                         */ #define  NET_TCP_HDR_FLAG_ACK                     DEF_BIT_04 #define  NET_TCP_HDR_FLAG_PUSH                    DEF_BIT_03 #define  NET_TCP_HDR_FLAG_RESET                   DEF_BIT_02 #define  NET_TCP_HDR_FLAG_SYNC                    DEF_BIT_01 #define  NET_TCP_HDR_FLAG_FIN                     DEF_BIT_00 #define  NET_TCP_HDR_FLAG_CLOSE                   NET_TCP_HDR_FLAG_FIN /* ********************************************************************************************************* *                                          TCP FLAG DEFINES ********************************************************************************************************* */                                                                 /* ------------------ NET TCP FLAGS ------------------- */ #define  NET_TCP_FLAG_NONE                        DEF_BIT_NONE #define  NET_TCP_FLAG_USED                        DEF_BIT_00    /* TCP conn cur used; i.e. NOT in free TCP conn pool.   */                                                                 /* ------------------ TCP TX  FLAGS ------------------- */                                                                 /* TCP tx flags copied from TCP hdr flags.              */ #define  NET_TCP_FLAG_TX_FIN                      NET_TCP_HDR_FLAG_FIN #define  NET_TCP_FLAG_TX_CLOSE                    NET_TCP_FLAG_TX_FIN #define  NET_TCP_FLAG_TX_SYNC                     NET_TCP_HDR_FLAG_SYNC #define  NET_TCP_FLAG_TX_RESET                    NET_TCP_HDR_FLAG_RESET #define  NET_TCP_FLAG_TX_PUSH                     NET_TCP_HDR_FLAG_PUSH #define  NET_TCP_FLAG_TX_ACK                      NET_TCP_HDR_FLAG_ACK #define  NET_TCP_FLAG_TX_URGENT                   NET_TCP_HDR_FLAG_URGENT #define  NET_TCP_FLAG_TX_BLOCK                    DEF_BIT_07                                                                 /* ------------------ TCP RX  FLAGS ------------------- */ #define  NET_TCP_FLAG_RX_DATA_PEEK                DEF_BIT_08 #define  NET_TCP_FLAG_RX_BLOCK                    DEF_BIT_15 /*$PAGE*/ /* ********************************************************************************************************* *                                          TCP TYPE DEFINES * * Note(s) : (1) NET_TCP_TYPE_&&& #define values specifically chosen as ASCII representations of the TCP *               types.  Memory displays of TCP types will display with their chosen ASCII names. ********************************************************************************************************* */                                                                 /* ------------------ NET TCP TYPES ------------------- */ #if     (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define  NET_TCP_TYPE_NONE                        0x4E4F4E45u   /* "NONE" in ASCII.                                     */ #define  NET_TCP_TYPE_CONN                        0x54435020u   /* "TCP " in ASCII.                                     */ #else #if     (CPU_CFG_DATA_SIZE   == CPU_WORD_SIZE_32) #define  NET_TCP_TYPE_NONE                        0x454E4F4Eu   /* "NONE" in ASCII.                                     */ #define  NET_TCP_TYPE_CONN                        0x20504354u   /* "TCP " in ASCII.                                     */ #elif   (CPU_CFG_DATA_SIZE   == CPU_WORD_SIZE_16) #define  NET_TCP_TYPE_NONE                        0x4F4E454Eu   /* "NONE" in ASCII.                                     */ #define  NET_TCP_TYPE_CONN                        0x43542050u   /* "TCP " in ASCII.                                     */ #else                                                           /* Dflt CPU_WORD_SIZE_08.                               */ #define  NET_TCP_TYPE_NONE                        0x4E4F4E45u   /* "NONE" in ASCII.                                     */ #define  NET_TCP_TYPE_CONN                        0x54435020u   /* "TCP " in ASCII.                                     */ #endif #endif /* ********************************************************************************************************* *                                     TCP SEQUENCE NUMBER DEFINES * * Note(s) : (1) TCP initial transmit sequence number is incremented by a fixed value, preferably a large *               prime value or a large value with multiple unique factors. * *               (a) One reasonable TCP initial transmit sequence number increment value example : * *                       65527  =  37 * 23 * 11 * 7 * * *               #### NET_TCP_TX_SEQ_NBR_CTR_INC could be developer-configured in 'net_cfg.h'. * *               See also 'NET_TCP_TX_GET_SEQ_NBR()  Notes #1b2 & #1c2'. ********************************************************************************************************* */ #define  NET_TCP_SEQ_NBR_NONE                              0u #define  NET_TCP_ACK_NBR_NONE                            NET_TCP_SEQ_NBR_NONE #define  NET_TCP_TX_SEQ_NBR_CTR_INC                    65527u   /* See Note #1.                                         */ #define  NET_TCP_ACK_NBR_DUP_WIN_SIZE_SCALE                4 /*$PAGE*/ /* ********************************************************************************************************* *                                    TCP DATA/TOTAL LENGTH DEFINES * * Note(s) : (1) (a) TCP total length #define's (NET_TCP_TOT_LEN)  relate to the total size of a complete *                   TCP packet, including the packet's TCP header.  Note that a complete TCP packet MAY *                   be fragmented in multiple Internet Protocol packets. * *               (b) TCP data  length #define's (NET_TCP_DATA_LEN) relate to the data  size of a complete *                   TCP packet, equal to the total TCP packet length minus its TCP header size.  Note  *                   that a complete TCP packet MAY be fragmented in multiple Internet Protocol packets. ********************************************************************************************************* */                                                                                 /* See Notes #1a & #1b.                 */ #define  NET_TCP_DATA_LEN_MIN                              0u #define  NET_TCP_TOT_LEN_MIN                            (NET_TCP_HDR_SIZE_MIN + NET_TCP_DATA_LEN_MIN) #define  NET_TCP_TOT_LEN_MAX                            (NET_IP_TOT_LEN_MAX   - NET_IP_HDR_SIZE_MIN ) #define  NET_TCP_DATA_LEN_MAX                           (NET_TCP_TOT_LEN_MAX  - NET_TCP_HDR_SIZE_MIN) /*$PAGE*/ /* ********************************************************************************************************* *                                      TCP SEGMENT SIZE DEFINES * * Note(s) : (1) (a) RFC # 879, Section 3 states that the TCP Maximum Segment Size "counts only *                   data octets in the segment, ... not the TCP header or the IP header". * *               (b) RFC #1122, Section 4.2.2.6 requires that : * *                   (1) "The MSS value to be sent in an MSS option must be less than or equal to * *                        (A) MMS_R - 20 * *                        where MMS_R is the maximum size for a transport-layer message that can *                        be received." * *                   (2) "If an MSS option is not received at connection setup, TCP MUST assume a *                        default send MSS of 536 (576 - 40)." * *                   See also 'net_ip.h  IP DATA/TOTAL LENGTH DEFINES  Note #1'. ********************************************************************************************************* */                                                                                         /* See Note #1.                 */ #define  NET_TCP_MAX_SEG_SIZE_DFLT                      (NET_IP_MAX_DATAGRAM_SIZE_DFLT - NET_IP_HDR_SIZE_MIN - NET_TCP_HDR_SIZE_MIN) #define  NET_TCP_MAX_SEG_SIZE_DFLT_RX                    NET_TCP_DATA_LEN_MAX           /* See Note #1b1.               */ #define  NET_TCP_MAX_SEG_SIZE_DFLT_TX                    NET_TCP_MAX_SEG_SIZE_DFLT      /* See Note #1b2.               */ #define  NET_TCP_MAX_SEG_SIZE_NONE                         0u #define  NET_TCP_MAX_SEG_SIZE_MIN                        NET_TCP_MAX_SEG_SIZE_DFLT #define  NET_TCP_MAX_SEG_SIZE_MAX                        NET_TCP_DATA_LEN_MAX #define  NET_TCP_SEG_LEN_MIN                             NET_TCP_DATA_LEN_MIN #define  NET_TCP_SEG_LEN_MAX                             NET_TCP_DATA_LEN_MAX #define  NET_TCP_SEG_LEN_SYNC                              1u #define  NET_TCP_SEG_LEN_FIN                               1u #define  NET_TCP_SEG_LEN_CLOSE                           NET_TCP_SEG_LEN_FIN #define  NET_TCP_SEG_LEN_ACK                               0u #define  NET_TCP_SEG_LEN_RESET                             0u #define  NET_TCP_SEG_LEN_PROBE                             0u #define  NET_TCP_DATA_LEN_TX_SYNC                          0u #define  NET_TCP_DATA_LEN_TX_FIN                           0u #define  NET_TCP_DATA_LEN_TX_CLOSE                       NET_TCP_DATA_LEN_TX_FIN #define  NET_TCP_DATA_LEN_TX_ACK                           0u #define  NET_TCP_DATA_LEN_TX_PROBE_NO_DATA                 0u #define  NET_TCP_DATA_LEN_TX_PROBE_DATA                    1u #define  NET_TCP_DATA_LEN_TX_RESET                         0u #define  NET_TCP_TX_PROBE_DATA                          0x00u /* ********************************************************************************************************* *                                       TCP WINDOW SIZE DEFINES * * Note(s) : (1) Although NO RFC specifies the absolute minimum TCP connection window size value allowed, *               RFC #793, Section 3.7 'Data Communication : Managing the Window' states that for "the *               window ... there is an assumption that this is related to the currently available data *               buffer space available for this connection". ********************************************************************************************************* */ #define  NET_TCP_WIN_SIZE_NONE                             0u #define  NET_TCP_WIN_SIZE_MIN                            NET_TCP_MAX_SEG_SIZE_MIN #define  NET_TCP_WIN_SIZE_MAX                            DEF_INT_16U_MAX_VAL /*$PAGE*/ /* ********************************************************************************************************* *                                     TCP HEADER OPTIONS DEFINES * * Note(s) : (1) See the following RFC's for TCP options summary : * *               (a) RFC # 793, Section  3.1 'Header Format : Options' *               (b) RFC #1122; Sections 4.2.2.5, 4.2.2.6 * *           (2) TCP option types are encoded in the first octet for each TCP option as follows : * *                           -------- *                           | TYPE | *                           -------- * *               The TCP option type value determines the TCP option format : * *               (a) The following TCP option types are single-octet TCP options -- i.e. the option type *                   octet is the ONLY octet for the TCP option. * *                   (1) TYPE =  0   End of Options List *                   (2) TYPE =  1   No Operation * * *               (b) All other TCP options MUST be multi-octet TCP options (see RFC #1122, Section 4.2.2.5) : * *                           ------------------------------ *                           | TYPE | LEN  |   TCP OPT    | *                           ------------------------------ * *                       where  *                               TYPE        Indicates the specific TCP option type *                               LEN         Indicates the total    TCP option length, in octets, including  *                                                the option type & the option length octets *                               TCP OPT     Additional TCP option octets, if any, that contain the remaining *                                                TCP option information * *                   The following TCP option types are multi-octet TCP options where the option's second *                   octet specify the total TCP option length, in octets, including the option type & the *                   option length octets : * *                   (1) TYPE =  2   Maximum Segment Size        See RFC # 793, Section  3.1 'Header Format : *                                                                   Options : Maximum Segment Size'; *                                                                   RFC #1122, Section 4.2.2.6; *                                                                   RFC # 879, Section 3 * *                   (2) TYPE =  3   Window  Scale               See 'net_tcp.h  Note #1c1' *                   (3) TYPE =  4   SACK Allowed                See 'net_tcp.h  Note #1c2' *                   (4) TYPE =  5   SACK Option                 See 'net_tcp.h  Note #1c2' *                   (5) TYPE =  6   Echo Request                See 'net_tcp.h  Note #1c3' *                   (6) TYPE =  7   Echo Reply                  See 'net_tcp.h  Note #1c3' *                   (7) TYPE =  8   Timestamp                   See 'net_tcp.h  Note #1c4' * *           (3) TCP header allows for a maximum option list length of 40 octets : * *                   NET_TCP_HDR_OPT_SIZE_MAX = NET_TCP_HDR_SIZE_MAX - NET_TCP_HDR_SIZE_MIN * *                                            = 60 - 20 * *                                            = 40 * *           (4) 'NET_TCP_OPT_SIZE'  MUST be pre-defined PRIOR to all definitions that require TCP option  *                size data type. ********************************************************************************************************* */ /*$PAGE*/ #define  NET_TCP_HDR_OPT_END_LIST                          0u #define  NET_TCP_HDR_OPT_NOP                               1u #define  NET_TCP_HDR_OPT_MAX_SEG_SIZE                      2u #define  NET_TCP_HDR_OPT_WIN_SCALE                         3u #define  NET_TCP_HDR_OPT_SACK_PERMIT                       4u #define  NET_TCP_HDR_OPT_SACK                              5u #define  NET_TCP_HDR_OPT_ECHO_REQ                          6u #define  NET_TCP_HDR_OPT_ECHO_REPLY                        7u #define  NET_TCP_HDR_OPT_TS                                8u #define  NET_TCP_HDR_OPT_PAD                             NET_TCP_HDR_OPT_END_LIST #define  NET_TCP_HDR_OPT_LEN_END_LIST                      1u #define  NET_TCP_HDR_OPT_LEN_NOP                           1u #define  NET_TCP_HDR_OPT_LEN_MAX_SEG_SIZE                  4u #define  NET_TCP_HDR_OPT_LEN_WIN_SCALE                     3u #define  NET_TCP_HDR_OPT_LEN_SACK_PERMIT                   2u #define  NET_TCP_HDR_OPT_LEN_ECHO_REQ                      6u #define  NET_TCP_HDR_OPT_LEN_ECHO_REPLY                    6u #define  NET_TCP_HDR_OPT_LEN_TS                           10u #define  NET_TCP_HDR_OPT_LEN_SACK_MIN                      6u #define  NET_TCP_HDR_OPT_LEN_SACK_MAX                     38u #define  NET_TCP_HDR_OPT_LEN_MIN                           1u #define  NET_TCP_HDR_OPT_LEN_MIN_LEN                       2u #define  NET_TCP_HDR_OPT_LEN_MAX                          38u typedef  CPU_INT32U  NET_TCP_OPT_SIZE;                          /* TCP opt size data type (see Note #4).                */ #define  NET_TCP_HDR_OPT_SIZE_WORD               (sizeof(NET_TCP_OPT_SIZE)) #define  NET_TCP_HDR_OPT_SIZE_MAX                       (NET_TCP_HDR_SIZE_MAX - NET_TCP_HDR_SIZE_MIN) #define  NET_TCP_HDR_OPT_NBR_MIN                           0u #define  NET_TCP_HDR_OPT_NBR_MAX                        (NET_TCP_HDR_OPT_SIZE_MAX / NET_TCP_HDR_OPT_SIZE_WORD) #define  NET_TCP_HDR_OPT_IX                              NET_TCP_HDR_SIZE_MIN /*$PAGE*/ /* ********************************************************************************************************* *                                TCP OPTION CONFIGURATION TYPE DEFINES * * Note(s) : (1) NET_TCP_OPT_CFG_TYPE_&&& #define values specifically chosen as ASCII representations of  *               the TCP option configuration types.  Memory displays of TCP option configuration buffers  *               will display the TCP option configuration TYPEs with their chosen ASCII names. ********************************************************************************************************* */                                                                 /* ---------------- TCP OPT CFG TYPES ----------------- */ #if     (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define  NET_TCP_OPT_CFG_TYPE_NONE                0x4E4F4E45u   /* "NONE" in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE        0x4D535320u   /* "MSS " in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_WIN_SCALE           0x57494E20u   /* "WIN " in ASCII (see 'net_tcp.h  Note #1c1').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK_PERMIT         0x53434B50u   /* "SCKP" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK                0x5341434Bu   /* "SACK" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REQ            0x45524551u   /* "EREQ" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REPLY          0x4543484Fu   /* "ECHO" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_TS                  0x54532020u   /* "TS  " in ASCII (see 'net_tcp.h  Note #1c4').        */ #else #if     (CPU_CFG_DATA_SIZE   == CPU_WORD_SIZE_32) #define  NET_TCP_OPT_CFG_TYPE_NONE                0x454E4F4Eu   /* "NONE" in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE        0x2053534Du   /* "MSS " in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_WIN_SCALE           0x204E4957u   /* "WIN " in ASCII (see 'net_tcp.h  Note #1c1').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK_PERMIT         0x504B4353u   /* "SCKP" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK                0x4B434153u   /* "SACK" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REQ            0x51455245u   /* "EREQ" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REPLY          0x4F484345u   /* "ECHO" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_TS                  0x20205354u   /* "TS  " in ASCII (see 'net_tcp.h  Note #1c4').        */ #elif   (CPU_CFG_DATA_SIZE   == CPU_WORD_SIZE_16) #define  NET_TCP_OPT_CFG_TYPE_NONE                0x4F4E454Eu   /* "NONE" in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE        0x534D2053u   /* "MSS " in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_WIN_SCALE           0x4957204Eu   /* "WIN " in ASCII (see 'net_tcp.h  Note #1c1').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK_PERMIT         0x4353504Bu   /* "SCKP" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK                0x41534B43u   /* "SACK" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REQ            0x52455145u   /* "EREQ" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REPLY          0x43454F48u   /* "ECHO" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_TS                  0x53542020u   /* "TS  " in ASCII (see 'net_tcp.h  Note #1c4').        */ #else                                                           /* Dflt CPU_WORD_SIZE_08.                               */ #define  NET_TCP_OPT_CFG_TYPE_NONE                0x4E4F4E45u   /* "NONE" in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_MAX_SEG_SIZE        0x4D535320u   /* "MSS " in ASCII.                                     */ #define  NET_TCP_OPT_CFG_TYPE_WIN_SCALE           0x57494E20u   /* "WIN " in ASCII (see 'net_tcp.h  Note #1c1').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK_PERMIT         0x53434B50u   /* "SCKP" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_SACK                0x5341434Bu   /* "SACK" in ASCII (see 'net_tcp.h  Note #1c2').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REQ            0x45524551u   /* "EREQ" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_ECHO_REPLY          0x4543484Fu   /* "ECHO" in ASCII (see 'net_tcp.h  Note #1c3').        */ #define  NET_TCP_OPT_CFG_TYPE_TS                  0x54532020u   /* "TS  " in ASCII (see 'net_tcp.h  Note #1c4').        */ #endif #endif /*$PAGE*/ /* ********************************************************************************************************* *                                   TCP CONNECTION TIMEOUT DEFINES * * Note(s) : (1) (a) (1) RFC #1122, Section 4.2.2.13 'DISCUSSION' states that "the graceful close algorithm *                       of TCP requires that the connection state remain defined on (at least) one end of *                       the connection, for a timeout period of 2xMSL ... During this period, the (remote  *                       socket, local socket) pair that defines the connection is busy and cannot be reused". * *                   (2) The following sections reiterate that the TIME-WAIT state timeout scalar is two *                       maximum segment lifetimes (2 MSL) : * *                       (A) RFC #793, Section 3.9 'Event Processing : SEGMENT ARRIVES : *                               Check Sequence Number : TIME-WAIT STATE' *                       (B) RFC #793, Section 3.9 'Event Processing : SEGMENT ARRIVES : *                               Check FIN Bit         : TIME-WAIT STATE' * *               (b) (1) RFC #793, Section 3.3 'Sequence Numbers : Knowing When to Keep Quiet' states that *                       "the Maximum Segment Lifetime (MSL) is ... to be 2 minutes.  This is an engineering *                       choice, and may be changed if experience indicates it is desirable to do so". * *                   (2) Microsoft Corporation's Windows XP defaults MSL to 15 seconds. ********************************************************************************************************* */                                                                                     /* Max seg timeout (see Note #1b) : */ #define  NET_TCP_CONN_TIMEOUT_MAX_SEG_MIN_SEC   (  0u                           )   /* ... min  =  0 seconds            */ #define  NET_TCP_CONN_TIMEOUT_MAX_SEG_MAX_SEC   (  2u * DEF_TIME_NBR_SEC_PER_MIN)   /* ... max  =  2 minutes            */ #define  NET_TCP_CONN_TIMEOUT_MAX_SEG_DFLT_SEC  ( 15u                           )   /* ... dflt = 15 seconds            */ #define  NET_TCP_CONN_TIMEOUT_MAX_SEG_SCALAR       2u                               /* ... scalar (see Note #1a).       */ #define  NET_TCP_CONN_TIMEOUT_CONN_DFLT_SEC     (120u * DEF_TIME_NBR_SEC_PER_MIN)   /* Dflt conn timeout = 120 minutes  */ #define  NET_TCP_CONN_TIMEOUT_USER_DFLT_SEC     ( 30u * DEF_TIME_NBR_SEC_PER_MIN)   /* Dflt user timeout =  30 minutes  */ /*$PAGE*/ /* ********************************************************************************************************* *                                        TCP CONNECTION STATES * * Note(s) : (1) See the following RFC's for TCP state machine summary : * *               (a) RFC # 793; Sections 3.2, 3.4, 3.5, 3.9 *               (b) RFC #1122; Sections 4.2.2.8, 4.2.2.10, 4.2.2.11, 4.2.2.13, 4.2.2.18, 4.2.2.20 * *           (2) (a) #### Additional closing-data-available state used for closing connections to allow the *                   application layer to receive any remaining data. * *                   See also 'net_tcp.c  NetTCP_RxPktConnHandlerFinWait1()  Note #2f5A2', *                            'net_tcp.c  NetTCP_RxPktConnHandlerFinWait2()  Note #2f5B', *                            'net_tcp.c  NetTCP_RxPktConnHandlerClosing()   Note #2d2B2a1B', *                          & 'net_tcp.c  NetTCP_RxPktConnHandlerLastAck()   Note #2d2A1b'. ********************************************************************************************************* */ #define  NET_TCP_CONN_STATE_NONE                           0u #define  NET_TCP_CONN_STATE_FREE                           1u #define  NET_TCP_CONN_STATE_CLOSED                        10u #define  NET_TCP_CONN_STATE_LISTEN                        20u #define  NET_TCP_CONN_STATE_SYNC_RXD                      30u #define  NET_TCP_CONN_STATE_SYNC_RXD_PASSIVE              31u #define  NET_TCP_CONN_STATE_SYNC_RXD_ACTIVE               32u #define  NET_TCP_CONN_STATE_SYNC_TXD                      35u #define  NET_TCP_CONN_STATE_CONN                          40u #define  NET_TCP_CONN_STATE_FIN_WAIT_1                    50u #define  NET_TCP_CONN_STATE_FIN_WAIT_2                    51u #define  NET_TCP_CONN_STATE_CLOSING                       52u #define  NET_TCP_CONN_STATE_TIME_WAIT                     53u #define  NET_TCP_CONN_STATE_CLOSE_WAIT                    55u #define  NET_TCP_CONN_STATE_LAST_ACK                      56u #define  NET_TCP_CONN_STATE_CLOSING_DATA_AVAIL            59u   /* See Note #2a.                                        */ /* ********************************************************************************************************* *                                     TCP CONNECTION QUEUE STATES ********************************************************************************************************* */ #define  NET_TCP_RX_Q_STATE_NONE                           0u #define  NET_TCP_RX_Q_STATE_CLOSED                       100u #define  NET_TCP_RX_Q_STATE_CLOSING                      101u #define  NET_TCP_RX_Q_STATE_SYNC                         110u #define  NET_TCP_RX_Q_STATE_CONN                         111u #define  NET_TCP_TX_Q_STATE_NONE                           0u #define  NET_TCP_TX_Q_STATE_CLOSED                       200u #define  NET_TCP_TX_Q_STATE_CLOSING                      201u #define  NET_TCP_TX_Q_STATE_SYNC                         210u #define  NET_TCP_TX_Q_STATE_CONN                         211u #define  NET_TCP_TX_Q_STATE_SUSPEND                      215u #define  NET_TCP_TX_Q_STATE_CLOSED_SUSPEND               220u #define  NET_TCP_TX_Q_STATE_CLOSING_SUSPEND              221u /*$PAGE*/ /* ********************************************************************************************************* *                                     TCP CONNECTION CODE DEFINES **************

    标签: tcp uCOS-II

    上传时间: 2015-11-22

    上传用户:the same kong

  • 数据库创建

    数据库创建千万旅客们快去问了么去了1里面1了卡牌卡牌跑跑

    标签: word

    上传时间: 2015-12-28

    上传用户:凌悠12345

  • 高质量C++&C 编程指南

    软件质量是被大多数程序员挂在嘴上而不是放在心上的东西! 除了完全外行和真正的编程高手外,初读本书,你最先的感受将是惊慌:“哇!我 以前捏造的 除了完全外行和真正的编程高手外,初读本书,你最先的感受将是惊慌:“哇!我 以前捏造的  C++/ C 程序怎么会有那么多的毛病?” 。 别难过,作者只不过比你早几年、多几次惊慌而已。 面 请花一两个小时认真阅读这本百页经书,你将会获益匪浅,这是前面 1 N- 1 个读者的 建议。

    标签: 高质量 编程指南

    上传时间: 2016-08-13

    上传用户:lansedeyuntkn

  • 批处理感知器算法

    批处理感知器算法的代码matlab w1=[1,0.1,1.1;1,6.8,7.1;1,-3.5,-4.1;1,2.0,2.7;1,4.1,2.8;1,3.1,5.0;1,-0.8,-1.3;     1,0.9,1.2;1,5.0,6.4;1,3.9,4.0]; w2=[1,7.1,4.2;1,-1.4,-4.3;1,4.5,0.0;1,6.3,1.6;1,4.2,1.9;1,1.4,-3.2;1,2.4,-4.0;     1,2.5,-6.1;1,8.4,3.7;1,4.1,-2.2]; w3=[1,-3.0,-2.9;1,0.5,8.7;1,2.9,2.1;1,-0.1,5.2;1,-4.0,2.2;1,-1.3,3.7;1,-3.4,6.2;     1,-4.1,3.4;1,-5.1,1.6;1,1.9,5.1]; figure; plot(w3(:,2),w3(:,3),'ro'); hold on; plot(w2(:,2),w2(:,3),'b+'); W=[w2;-w3];%增广样本规范化 a=[0,0,0]; k=0;%记录步数 n=1; y=zeros(size(W,2),1);%记录错分的样本 while any(y<=0)     k=k+1;     y=a*transpose(W);%记录错分的样本     a=a+sum(W(find(y<=0),:));%更新a     if k >= 250         break     end end if k<250     disp(['a为:',num2str(a)])      disp(['k为:',num2str(k)]) else      disp(['在250步以内没有收敛,终止']) end %判决面:x2=-a2*x1/a3-a1/a3 xmin=min(min(w1(:,2)),min(w2(:,2))); xmax=max(max(w1(:,2)),max(w2(:,2))); x=xmin-1:xmax+1;%(xmax-xmin): y=-a(2)*x/a(3)-a(1)/a(3); plot(x,y)

    标签: 批处理 算法matlab

    上传时间: 2016-11-07

    上传用户:a1241314660

  • RVDS2.2破解工具

    RealView Developer Suite v2.2 破解 (2009-12-11)  使用RealView Developer Suite v2.2,传说中的RVDS 2.2,破解也有问题,经过我琢磨。   破解步骤修改如下: 1)用generate产生license file (注意自己的系统时间   最好是真实的当前时间,如果时间比较旧的话,产生的license file 将不能注册。license file 和系统时间、网卡物理地址、硬盘的序列号有关) 2)安装软件 3)license Wizard     选  Install Wizard   ...   选择license file 目录    4)应用补丁注入工具Patch.exe给下边列出的文件注入校验和。文件目录见下边。     从这个论坛下载说明少了4个文件路径,导致的结果就是无法启动调试部分。   关于 no license check  out   以上作完了就加载一个*.axf文件实验吧,看看还有没有no license check  out  ,这时你在看软件注册信息 Enjoy ;-)   Install, apply our patch then generate license file with the keygen.   -------------   the files need to be patched:      %Install Path%\IDEs\CodeWarrior\CodeWarrior\5.6.1\1592\win_32-pentium\bin\Plugins\License\oemlicense.dll   %Install Path%\IDEs\CodeWarrior\RVPlugins\1.0\86\win_32-pentium\oemlicense\oemlicense.dll   %Install Path%\RDI\armsd\1.3.1\66\win_32-pentium\armsd.exe   %Install Path%\RDI\AXD\1.3.1\98\win_32-pentium\axd.exe   %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armasm.exe   %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armcc.exe   %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armcpp.exe   %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armlink.exe   %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\fromelf.exe   %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\tcc.exe   %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\tcpp.exe   %Install Path%\RVD\Core\1.8\734\win_32-pentium\bin\tvs.exe   %Install Path%\RVD\Core\1.8\734\win_32-pentium\bin\xry100.dll

    标签: RVDS2 破解

    上传时间: 2017-01-18

    上传用户:zbxinu

  • AP2406技术手册

    The AP2406 is a 1.5Mhz constant frequency, slope compensated current mode PWM step-down converter. The device integrates a main switch and a synchronous rectifier for high efficiency without an external Schottky diode. It is ideal for powering portable equipment that runs from a single cell lithium-Ion (Li+) battery. The AP2406 can supply 600mA of load current from a 2.5V to 5.5V input voltage. The output voltage can be regulated as low as 0.6V. The AP2406 can also run at 100% duty cycle for low dropout operation, extending battery life in portable system. Idle mode operation at light loads provides very low output ripple voltage for noise sensitive applications. The AP2406 is offered in a low profile (1mm) 5-pin, thin SOT package, and is available in an adjustable version and fixed output voltage of 1.2V, 1.5V and 1.8V

    标签: 2406 AP 技术手册

    上传时间: 2017-02-23

    上传用户:w124141

  • 点亮P10单元板单片机源程序

    /*================================================================= 4扫16*16下入上出C语言程序, 低位起笔,数据反相。 预定义 **************************************************************/ #include #include //可使用其中定义的宏来访问绝对地址? bit ture=1; // 使能正反相位选择 bit false=0; // 使能反相 sbit SCK=P3^6; // EQU 0B6H ; 移位 sbit RCK=P3^5; //EQU 0B5H ; 并行锁存 //sbit P1_3=P1^3; //外RAM扩展读写控制,不能重复申明 sbit EN1=P1^7; //BIT sbit FB=0xD8; // FB作为标志 sfr BUS_SPEED=0xA1; //访问片外RAM速度设置寄存器 sfr P4SW=0xBB; //P4SW寄存器设置P4.4,P4.5,P4.6的功能 sfr P4=0xC0; // P4 EQU 0C0H sbit NC=P4^4; sbit CS=P4^6; //片选 sfr WDT_CONTR=0xC1; // 0C1H ;看门狗寄存器 sfr AUXR=0x8E; // EQU 08EH ;附件功能控制寄存器 sfr16 DPTR=0x82; sfr CLK_DIV=0x97 ; //时钟分频寄存器 const unsigned int code All_zk =256 ; // 0E11H ;原数据总字节 const unsigned int code am_zk =128 ; // 0E13H ;单幕数据量 const unsigned char code asp = 255; // asp数据相位字,如果是正相字,那么asp=0 bit basp=1; // asp数据相位字标记,如果是正相字,那么basp=0 const unsigned char code font[]= // 晶科电子LED数码(反相字) {0xBD,0x81,0xEF,0xFF,0xBD,0x81,0xF7,0xFF,0xEF,0xEB,0x80,0x9F,0xEF,0x8F,0xEF,0xEF,0x7F,0x7B,0x7B,0x7F,0xBF,0xEF,0xEF,0xFF,0x7F,0x00,0xFF,0xFF,0xFF,0x80,0xFE,0xFF, 0x81,0xBD,0x0F,0x0F,0x81,0xBD,0xF0,0xF0,0xEF,0xED,0xE7,0xE1,0xEF,0xE1,0xEE,0xEE,0x7F,0x7B,0x7B,0x7F,0xBF,0xEF,0xEF,0xFF,0x7F,0x7F,0x7F,0x03,0xFF,0xFF,0xFF,0xF0, 0xBD,0x81,0xEF,0xEF,0xBD,0x81,0xF7,0xF7,0xEF,0x2E,0xC7,0xEF,0xEF,0xEE,0xED,0xED,0xFF,0x03,0x03,0x7F,0x80,0xE0,0xE0,0xFF,0x5F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFB, 0xFF,0xBD,0xFF,0x0F,0xFF,0xBD,0xFF,0xF0,0xEF,0xEF,0xAB,0xEF,0xEF,0xEF,0xED,0xED,0xFF,0x7B,0x7B,0x03,0xFF,0xEF,0xEF,0xE0,0xBF,0x7F,0x7F,0xFF,0xFF,0xFF,0xDF,0xFD, 0xBD,0xFD,0xFD,0xFF,0xBD,0xED,0xBD,0xFF,0xDD,0xBD,0xDD,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF,0xEF,0x00,0xEF,0xEB,0xEB,0x81,0xFB,0xC3,0xDA,0xF7,0xFF,0xDF,0xDF,0xEE,0xFF, 0x80,0xFD,0xFD,0xFF,0xC0,0xED,0xED,0xFF,0xE0,0xBD,0xBD,0xFF,0xFF,0xFF,0xFF,0xFF,0xB3,0x00,0xC7,0x6D,0x8D,0xEB,0xDD,0xF3,0xDB,0xDB,0xFB,0x40,0xDF,0xDF,0xEE,0xE0, 0xFF,0xFD,0xFD,0xFF,0xFF,0xFD,0xED,0xFF,0xFF,0xBD,0xBD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xB7,0x2B,0xAB,0xDE,0xF7,0xDD,0xFB,0xFB,0x5B,0xC3,0xF7,0xEB,0xD0,0xEE,0xEF, 0xFF,0xFD,0xFD,0xF8,0xFF,0xBD,0xE1,0xC0,0xFF,0xBD,0xBD,0xE0,0xFF,0xFF,0xFF,0xFF,0xFF,0xD3,0xED,0xC7,0xFF,0xF7,0xDC,0xFB,0xFF,0xDB,0xD9,0xF7,0xF7,0xDF,0xC0,0xEE}; const unsigned char data xzL_data =0x08; //0603H;一幕一行字节数 const unsigned int data aL_data =0x20; //单幕单号线(单组线)数据量 const unsigned char data mov =0x03A ; //移动速度 const unsigned int data t_T =0x040A ; //0E0AH ; 05FAH; ;停留时间 const unsigned char data mu_num=0x02 ; //0602H ;幕数 unsigned int m; //m幕长变量<=am_zk unsigned char data_z; //数据寄存器 unsigned int xd; //数据指针寄存器 /*********************************************************************** 数据转移子函数 ===============================================================*/ char MOVD() { unsigned char f,nm; //nm幕数控制 unsigned char code *dptr; unsigned char xdata *xdptr = 0; f = asp ; for (m=0; m

    标签: P10 单元板 单片机源程序

    上传时间: 2017-05-04

    上传用户:sbfd010