zoukankan      html  css  js  c++  java
  • RTT常用数据类型

    RTT常用数据类型定义在rtdef.h中

    /* RT-Thread basic data type definitions */
    typedef signed   char                   rt_int8_t;      /**<  8bit integer type */
    typedef signed   short                  rt_int16_t;     /**< 16bit integer type */
    typedef signed   long                   rt_int32_t;     /**< 32bit integer type */
    typedef unsigned char                   rt_uint8_t;     /**<  8bit unsigned integer type */
    typedef unsigned short                  rt_uint16_t;    /**< 16bit unsigned integer type */
    typedef unsigned long                   rt_uint32_t;    /**< 32bit unsigned integer type */
    typedef int                             rt_bool_t;      /**< boolean type */
    
    /* 32bit CPU */
    typedef long                            rt_base_t;      /**< Nbit CPU related date type */
    typedef unsigned long                   rt_ubase_t;     /**< Nbit unsigned CPU related data type */
    
    typedef rt_base_t                       rt_err_t;       /**< Type for error number */
    typedef rt_uint32_t                     rt_time_t;      /**< Type for time stamp */
    typedef rt_uint32_t                     rt_tick_t;      /**< Type for tick count */
    typedef rt_base_t                       rt_flag_t;      /**< Type for flags */
    typedef rt_ubase_t                      rt_size_t;      /**< Type for size number */
    typedef rt_ubase_t                      rt_dev_t;       /**< Type for device */
    typedef rt_base_t                       rt_off_t;       /**< Type for offset */
    
    /* boolean type definitions */
    #define RT_TRUE                         1               /**< boolean true  */
    #define RT_FALSE                        0               /**< boolean fails */
    /* RT-Thread error code definitions */
    #define RT_EOK                          0               /**< There is no error */
    #define RT_ERROR                        1               /**< A generic error happens */
    #define RT_ETIMEOUT                     2               /**< Timed out */
    #define RT_EFULL                        3               /**< The resource is full */
    #define RT_EEMPTY                       4               /**< The resource is empty */
    #define RT_ENOMEM                       5               /**< No memory */
    #define RT_ENOSYS                       6               /**< No system */
    #define RT_EBUSY                        7               /**< Busy */
    #define RT_EIO                          8               /**< IO error */

    现在感觉问题:类型带_t,容易与后续指针混淆,定义的后续实体变量指针都带_t,如:

    typedef struct rt_device *rt_device_t;

  • 相关阅读:
    操作系统的磁盘结构、磁盘管理、磁盘调度算法
    ArrayList源码解析--值得深读
    深入理解static、volatile关键字
    7:高阶张量操作
    6:统计属性
    5:张量的基本运算
    4.1张量的操作(broadcasting维度自动扩张,拼接与拆分)
    4:张量操作
    3:索引与切片
    2:pytorch的基本数据类型以及张量的创建
  • 原文地址:https://www.cnblogs.com/embedded-linux/p/5459856.html
Copyright © 2011-2022 走看看