OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3610|回复: 4

使用iar 编译器 数据大于 0x80就显示不出来,是什么情况?

[复制链接]

259

主题

806

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1887
金钱
1887
注册时间
2012-10-28
在线时间
353 小时
发表于 2016-11-5 09:05:53 | 显示全部楼层 |阅读模式
1金钱
本帖最后由 hpdell 于 2016-11-5 09:07 编辑

我的iar 编译器,在程序仿真时,数据值大于0x80的还是不能够显示出来,是什么情况?
不是数组大的原因,我单独定义一个8位的变量也是 如此,定义的数据类型是 uint8_t

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

头像被屏蔽

227

主题

293

帖子

0

精华

禁止发言

积分
1006
金钱
1006
注册时间
2012-2-9
在线时间
69 小时
发表于 2016-11-6 18:14:54 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

259

主题

806

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1887
金钱
1887
注册时间
2012-10-28
在线时间
353 小时
 楼主| 发表于 2016-11-7 10:04:16 | 显示全部楼层
dengxiaojun12 发表于 2016-11-6 18:14
因为ascii码值最大7F啊,用HEX方式显示就能显示了吧

使用 hex 也不行啊,

变量类型定义为 uint16_t , uint32_t 的都可以,唯独这个 uint8_t的类型不行
回复

使用道具 举报

70

主题

6758

帖子

0

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
13002
金钱
13002
注册时间
2012-11-26
在线时间
3791 小时
发表于 2016-11-7 10:14:55 | 显示全部楼层
hpdell 发表于 2016-11-7 10:04
使用 hex 也不行啊,

变量类型定义为 uint16_t , uint32_t 的都可以,唯独这个 uint8_t的类型不行

你追踪下你的uint8_t 代表的是有符号的还是无符号的

学无止境
回复

使用道具 举报

259

主题

806

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1887
金钱
1887
注册时间
2012-10-28
在线时间
353 小时
 楼主| 发表于 2016-11-7 10:49:44 | 显示全部楼层
jermy_z 发表于 2016-11-7 10:14
你追踪下你的uint8_t 代表的是有符号的还是无符号的

就是这个类型  

/* Fixed size types. These are all optional. */
#ifdef __INT8_T_TYPE__
  typedef __INT8_T_TYPE__   int8_t;
  typedef __UINT8_T_TYPE__ uint8_t;
#endif /* __INT8_T_TYPE__ */


__UINT8_T_TYPE__ 这个类型再找就找不到了

我吧他改成 unsigned char 也是一样的

估计应该是哪个地方的设置问题吧

下面是在 stdint .h里面定义的
/* stdint.h standard header */
/* Copyright 2003-2010 IAR Systems AB.  */
#ifndef _STDINT
#define _STDINT

#ifndef _SYSTEM_BUILD
  #pragma system_include
#endif

#include <ycheck.h>
#include <yvals.h>
_C_STD_BEGIN

/* Fixed size types. These are all optional. */
#ifdef __INT8_T_TYPE__
  typedef __INT8_T_TYPE__   int8_t;
  typedef __UINT8_T_TYPE__ uint8_t;
#endif /* __INT8_T_TYPE__ */

#ifdef __INT16_T_TYPE__
  typedef __INT16_T_TYPE__   int16_t;
  typedef __UINT16_T_TYPE__ uint16_t;
#endif /* __INT16_T_TYPE__ */

#ifdef __INT32_T_TYPE__
  typedef __INT32_T_TYPE__   int32_t;
  typedef __UINT32_T_TYPE__ uint32_t;
#endif /* __INT32_T_TYPE__ */

#ifdef __INT64_T_TYPE__
  #pragma language=save
  #pragma language=extended
  typedef __INT64_T_TYPE__   int64_t;
  typedef __UINT64_T_TYPE__ uint64_t;
  #pragma language=restore
#endif /* __INT64_T_TYPE__ */

/* Types capable of holding at least a certain number of bits.
   These are not optional for the sizes 8, 16, 32, 64. */
typedef __INT_LEAST8_T_TYPE__   int_least8_t;
typedef __UINT_LEAST8_T_TYPE__ uint_least8_t;

typedef __INT_LEAST16_T_TYPE__   int_least16_t;
typedef __UINT_LEAST16_T_TYPE__ uint_least16_t;

typedef __INT_LEAST32_T_TYPE__   int_least32_t;
typedef __UINT_LEAST32_T_TYPE__ uint_least32_t;

/* This isn't really optional, but make it so for now. */
#ifdef __INT_LEAST64_T_TYPE__
  #pragma language=save
  #pragma language=extended
  typedef __INT_LEAST64_T_TYPE__ int_least64_t;
  #pragma language=restore
#endif /* __INT_LEAST64_T_TYPE__ */
#ifdef __UINT_LEAST64_T_TYPE__
  #pragma language=save
  #pragma language=extended
  typedef __UINT_LEAST64_T_TYPE__ uint_least64_t;
  #pragma language=restore
#endif /* __UINT_LEAST64_T_TYPE__ */

/* The fastest type holding at least a certain number of bits.
   These are not optional for the size 8, 16, 32, 64.
   For now, the 64 bit size is optional in IAR compilers. */
typedef __INT_FAST8_T_TYPE__   int_fast8_t;
typedef __UINT_FAST8_T_TYPE__ uint_fast8_t;

typedef __INT_FAST16_T_TYPE__   int_fast16_t;
typedef __UINT_FAST16_T_TYPE__ uint_fast16_t;

typedef __INT_FAST32_T_TYPE__   int_fast32_t;
typedef __UINT_FAST32_T_TYPE__ uint_fast32_t;

#ifdef __INT_FAST64_T_TYPE__
  #pragma language=save
  #pragma language=extended
  typedef __INT_FAST64_T_TYPE__ int_fast64_t;
  #pragma language=restore
#endif /* __INT_FAST64_T_TYPE__ */
#ifdef __UINT_FAST64_T_TYPE__
  #pragma language=save
  #pragma language=extended
  typedef __UINT_FAST64_T_TYPE__ uint_fast64_t;
  #pragma language=restore
#endif /* __UINT_FAST64_T_TYPE__ */

/* The integer type capable of holding the largest number of bits. */
#pragma language=save
#pragma language=extended
typedef __INTMAX_T_TYPE__   intmax_t;
typedef __UINTMAX_T_TYPE__ uintmax_t;
#pragma language=restore

/* An integer type large enough to be able to hold a pointer.
   This is optional, but always supported in IAR compilers. */
typedef __INTPTR_T_TYPE__   intptr_t;
typedef __UINTPTR_T_TYPE__ uintptr_t;

/* An integer capable of holding a pointer to a specific memory type. */
#define __DATA_PTR_MEM_HELPER1__(M, I)                     \
typedef __DATA_MEM##I##_INTPTR_TYPE__ M##_intptr_t;        \
typedef __DATA_MEM##I##_UINTPTR_TYPE__ M##_uintptr_t;
__DATA_PTR_MEMORY_LIST1__()
#undef __DATA_PTR_MEM_HELPER1__

/* Minimum and maximum limits. */
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)

#ifdef __INT8_T_TYPE__
  #define INT8_MAX   __INT8_T_MAX__
  #define INT8_MIN   __INT8_T_MIN__
  #define UINT8_MAX __UINT8_T_MAX__
#endif

#ifdef __INT16_T_TYPE__
  #define INT16_MAX   __INT16_T_MAX__
  #define INT16_MIN   __INT16_T_MIN__
  #define UINT16_MAX __UINT16_T_MAX__
#endif

#ifdef __INT32_T_TYPE__
  #define INT32_MAX   __INT32_T_MAX__
  #define INT32_MIN   __INT32_T_MIN__
  #define UINT32_MAX __UINT32_T_MAX__
#endif

#ifdef __INT64_T_TYPE__
  #define INT64_MAX   __INT64_T_MAX__
  #define INT64_MIN   __INT64_T_MIN__
  #define UINT64_MAX __UINT64_T_MAX__
#endif

#define INT_LEAST8_MAX   __INT_LEAST8_T_MAX__
#define INT_LEAST8_MIN   __INT_LEAST8_T_MIN__
#define UINT_LEAST8_MAX __UINT_LEAST8_T_MAX__

#define INT_LEAST16_MAX   __INT_LEAST16_T_MAX__
#define INT_LEAST16_MIN   __INT_LEAST16_T_MIN__
#define UINT_LEAST16_MAX __UINT_LEAST16_T_MAX__

#define INT_LEAST32_MAX   __INT_LEAST32_T_MAX__
#define INT_LEAST32_MIN   __INT_LEAST32_T_MIN__
#define UINT_LEAST32_MAX __UINT_LEAST32_T_MAX__

#ifdef __INT_LEAST64_T_TYPE__
  #define INT_LEAST64_MAX __INT_LEAST64_T_MAX__
  #define INT_LEAST64_MIN __INT_LEAST64_T_MIN__
#endif

#ifdef __UINT_LEAST64_T_TYPE__
  #define UINT_LEAST64_MAX __UINT_LEAST64_T_MAX__
#endif

#define INT_FAST8_MAX   __INT_FAST8_T_MAX__
#define INT_FAST8_MIN   __INT_FAST8_T_MIN__
#define UINT_FAST8_MAX __UINT_FAST8_T_MAX__

#define INT_FAST16_MAX   __INT_FAST16_T_MAX__
#define INT_FAST16_MIN   __INT_FAST16_T_MIN__
#define UINT_FAST16_MAX __UINT_FAST16_T_MAX__

#define INT_FAST32_MAX   __INT_FAST32_T_MAX__
#define INT_FAST32_MIN   __INT_FAST32_T_MIN__
#define UINT_FAST32_MAX __UINT_FAST32_T_MAX__

#ifdef __INT_FAST64_T_TYPE__
  #define INT_FAST64_MAX __INT_FAST64_T_MAX__
  #define INT_FAST64_MIN __INT_FAST64_T_MIN__
#endif

#ifdef __UINT_FAST64_T_TYPE__
  #define UINT_FAST64_MAX __UINT_FAST64_T_MAX__
#endif

#define INTMAX_MAX   __INTMAX_T_MAX__
#define INTMAX_MIN   __INTMAX_T_MIN__
#define UINTMAX_MAX __UINTMAX_T_MAX__

#define SIZE_MAX __SIZE_T_MAX__

#define PTRDIFF_MAX __PTRDIFF_T_MAX__
#define PTRDIFF_MIN __PTRDIFF_T_MIN__

#define INTPTR_MAX   __INTPTR_T_MAX__
#define INTPTR_MIN   __INTPTR_T_MIN__
#define UINTPTR_MAX __UINTPTR_T_MAX__

#define WCHAR_MIN _WCMIN
#define WCHAR_MAX _WCMAX

#define WINT_MIN _WIMIN
#define WINT_MAX _WIMAX

#define SIG_ATOMIC_MIN __SIGNED_CHAR_MIN__
#define SIG_ATOMIC_MAX __SIGNED_CHAR_MAX__


#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */


/* Macros expanding to integer constants. */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)

#ifdef __INT8_T_TYPE__
  #define INT8_C(x)  _GLUE(x,__INT8_C_SUFFIX__)
  #define UINT8_C(x) _GLUE(x,__UINT8_C_SUFFIX__)
#endif

#ifdef __INT16_T_TYPE__
  #define INT16_C(x)  _GLUE(x,__INT16_C_SUFFIX__)
  #define UINT16_C(x) _GLUE(x,__UINT16_C_SUFFIX__)
#endif

#ifdef __INT32_T_TYPE__
  #define INT32_C(x)  _GLUE(x,__INT32_C_SUFFIX__)
  #define UINT32_C(x) _GLUE(x,__UINT32_C_SUFFIX__)
#endif

#ifdef __INT_LEAST64_T_TYPE__
  #define INT64_C(x) _GLUE(x,__INT64_C_SUFFIX__)
#endif

#ifdef __UINT_LEAST64_T_TYPE__
  #define UINT64_C(x) _GLUE(x,__UINT64_C_SUFFIX__)
#endif

#define INTMAX_C(x)  _GLUE(x,__INTMAX_C_SUFFIX__)
#define UINTMAX_C(x) _GLUE(x,__UINTMAX_C_SUFFIX__)

#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */

_C_STD_END
#endif /* _STDINT */

#if defined(_STD_USING)
  using _CSTD int8_t; using _CSTD int16_t;
  using _CSTD int32_t; using _CSTD int64_t;

  using _CSTD uint8_t; using _CSTD uint16_t;
  using _CSTD uint32_t; using _CSTD uint64_t;

  using _CSTD int_least8_t; using _CSTD int_least16_t;
  using _CSTD int_least32_t;  using _CSTD int_least64_t;
  using _CSTD uint_least8_t; using _CSTD uint_least16_t;
  using _CSTD uint_least32_t; using _CSTD uint_least64_t;

  using _CSTD intmax_t; using _CSTD uintmax_t;

  using _CSTD uintptr_t;
  using _CSTD intptr_t;

  using _CSTD int_fast8_t; using _CSTD int_fast16_t;
  using _CSTD int_fast32_t; using _CSTD int_fast64_t;
  using _CSTD uint_fast8_t; using _CSTD uint_fast16_t;
  using _CSTD uint_fast32_t; using _CSTD uint_fast64_t;
#endif /* defined(_STD_USING) */

/*
* Copyright (c) 1992-2009 by P.J. Plauger.  ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
V5.04:0576 */












回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-3-1 09:47

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表