1、在  TI  的 BLE 协议栈 中,即 OSAL 中 获取当前 系统 tick 的方法如下

 /*
* Read the system clock - returns milliseconds
*/
extern uint32 osal_GetSystemClock( void );

2、32位 的变量 用于表示 ms ,可以表示多少天那?关系如下:

2^32 ms = 

4294967296 ms =

4294967.296 S = 

71582.788266666666666666666666667 分钟 = 

1193.0464711111111111111111111111 小时 = 

49.71026962962962962962962962963 天

/******************************************************************************

 @file  OSAL_Timers.h

 @brief This file contains the OSAL Timer definition and manipulation functions.

 Group: WCS, BTS
Target Device: CC2540, CC2541 ****************************************************************************** Copyright (c) 2004-2016, Texas Instruments Incorporated
All rights reserved. IMPORTANT: Your use of this Software is limited to those specific rights
granted under the terms of a software license agreement between the user
who downloaded the software, his/her employer (which must be your employer)
and Texas Instruments Incorporated (the "License"). You may not use this
Software unless you agree to abide by the terms of the License. The License
limits your use, and you acknowledge, that the Software may not be modified,
copied or distributed unless embedded on a Texas Instruments microcontroller
or used solely and exclusively in conjunction with a Texas Instruments radio
frequency transceiver, which is integrated into your product. Other than for
the foregoing purpose, you may not use, reproduce, copy, prepare derivative
works of, modify, distribute, perform, display or sell this Software and/or
its documentation for any purpose. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
PROVIDED 揂S IS?WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. Should you have any questions regarding your right to use this Software,
contact Texas Instruments Incorporated at www.TI.com. ******************************************************************************
Release Name: ble_sdk_1.4.2.2
Release Date: 2016-06-09 06:57:09
*****************************************************************************/ #ifndef OSAL_TIMERS_H
#define OSAL_TIMERS_H #ifdef __cplusplus
extern "C"
{
#endif /*********************************************************************
* INCLUDES
*/ /*********************************************************************
* MACROS
*/ /*********************************************************************
* CONSTANTS
* the unit is chosen such that the 320us tick equivalent can fit in
* 32 bits.
*/
#define OSAL_TIMERS_MAX_TIMEOUT 0x28f5c28e /* unit is ms*/ /*********************************************************************
* TYPEDEFS
*/ /*********************************************************************
* GLOBAL VARIABLES
*/ /*********************************************************************
* FUNCTIONS
*/ /*
* Initialization for the OSAL Timer System.
*/
extern void osalTimerInit( void ); /*
* Set a Timer
*/
extern uint8 osal_start_timerEx( uint8 task_id, uint16 event_id, uint32 timeout_value ); /*
* Set a timer that reloads itself.
*/
extern uint8 osal_start_reload_timer( uint8 taskID, uint16 event_id, uint32 timeout_value ); /*
* Stop a Timer
*/
extern uint8 osal_stop_timerEx( uint8 task_id, uint16 event_id ); /*
* Get the tick count of a Timer.
*/
extern uint32 osal_get_timeoutEx( uint8 task_id, uint16 event_id ); /*
* Simulated Timer Interrupt Service Routine
*/ extern void osal_timer_ISR( void ); /*
* Adjust timer tables
*/
extern void osal_adjust_timers( void ); /*
* Update timer tables
*/
extern void osalTimerUpdate( uint32 updateTime ); /*
* Count active timers
*/
extern uint8 osal_timer_num_active( void ); /*
* Set the hardware timer interrupts for sleep mode.
* These functions should only be called in OSAL_PwrMgr.c
*/
extern void osal_sleep_timers( void );
extern void osal_unsleep_timers( void ); /*
* Read the system clock - returns milliseconds
*/
extern uint32 osal_GetSystemClock( void ); /*
* Get the next OSAL timer expiration.
* This function should only be called in OSAL_PwrMgr.c
*/
extern uint32 osal_next_timeout( void ); /*********************************************************************
*********************************************************************/ #ifdef __cplusplus
}
#endif #endif /* OSAL_TIMERS_H */

32位 的变量 用于表示 ms ,可以表示多少天那?的更多相关文章

  1. Visual Studio远程调试监视器(MSVSMON.EXE)的32位版本不能用于调试64位进程或64位转储

    在VS2013中调试Silverlight项目时,提示:无法附加.Visual Studio远程调试监视器(MSVSMON.EXE)的32位版本不能用于调试64位进程或64位转储.请改用64位版本. ...

  2. php 生成32位随机字符串 用于支付验证 用户注册

    //32位随机字符串 function randstrpay($length=32) { $rand=''; $randstr= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567 ...

  3. VS本地调试 Visual Studio远程调试监视器(MSVSMON.EXE)的32位版本不能用于调试64位进程或64位转储

    vs2017 调试一致都没啥问题,今天莫名报这个错误,感觉好奇怪,网上搜索了半天也没解决,最后看着错误信息感觉很诡异,我本地调试你给我启动远程调试监测器干嘛,localhost也访问不了,ping了一 ...

  4. js 生成32位随机数,可用于微信支付流水号(前端生成)

    $(function () { /*生成32位随机流水号*/ /*默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1*/ var $chars = 'ABCDEFGHJKMNPQRSTWXYZ ...

  5. WIN10 + VS 2013 配置Opencv2.4.1.3 32位

    VS2013 配置Opencv2.4.1.3    32位 系统变量 Path: F:\2biancheng_tool\Opencv2413\opencv\build\x86\vc12\bin 用户变 ...

  6. C语言变量长度在32位和64位处理器上的关系

    C语言变量长度在32位和64位处理器上的关系       理论上来讲 我觉得数据类型的字节数应该是由CPU决定的,但是实际上主要由编译器决定(占多少位由编译器在编译期间说了算).常用数据类型对应字节数 ...

  7. (面试题)请用C语言实现在32位环境下,两个无符号长整数相加的函数,相加之和不能存储在64位变量中

    分析:长整数相加,将结果分为高位和低位部分,分别保存在两个32整数中. 比如:unsigned int a = 0xFFFFFFFF, unsigned int b = 0x1, 结果用unsigne ...

  8. arm32位固定指令中怎么容纳32位变量

    在ARM指令集汇编码中.32位有效马上数是通过______偶数位而间接得到的 A.循环左移 B.循环右移. C.逻辑左移. D.逻辑右移 答案为循环左移.为什么?还有最好解释一下逻辑移动和循环移动的概 ...

  9. Window 32位 编程总结

    Lesson01 win32 Window 32位 编程 1.Windows编程基础 2.Windows的字符 3.窗口处理 4.消息处理 5.绘图 6.对话框 7.控件 Win32编程: Windo ...

随机推荐

  1. 【Android】利用回收机制创建ListView列表实现

    MainActivity.java package com.glandroid.listviewdemo; import android.graphics.Color; import android. ...

  2. 第2课 android机器人的翻页相册

    一.准备:准备像素大小相同的图片若干张.(本例中的图片,统一像素大小为310*310,请保存至本机电脑并按顺序命名为1.jpg至6.jpg) 二.启动与登陆: 启动谷歌浏览器,并在地址栏里输入loca ...

  3. Java 设计模式(三)-单例模式(Singleton Pattern)

    1     概念定义 1.1   定义 确保一个类只有一个实例,而且自行实例化并向整个系统提供这个实例. 1.2   类型 创建类模式 1.3   难点 1)多个虚拟机 当系统中的单例类被拷贝运行在多 ...

  4. Python用户交互-密码不可见

    输入密码时若让用户不可见,可以使用getpass模块中的getpass方法 # 输入密码时若想要不可见,使用getpass模块中getpass方法即可 import getpass pwd=getpa ...

  5. 微信开发平台中有个接口是上传多媒体文件,我用的是java 开发的,我怎么样才能在后台实现呢?

    /**      * 文件上传到微信服务器      * @param fileType 文件类型      * @param filePath 文件路径      * @return JSONObj ...

  6. 打通版微社区(2):服务器部署MySql数据库 For DZ3.2

    写在前面:单独写部署MySql原因是,我这边的应用数据库都是独立存在的,数据与应用分别部署在不同的服务器.另外我也没有实际部署MySql的经验,特意写一篇日志,张记性.安装MySql参考了http:/ ...

  7. [翻译] ZFTokenField

    ZFTokenField 本人视频教程系类   iOS中CALayer的使用 效果图: iOS custom view that let you add token view inside like ...

  8. awk 截取某段时间的日志

    好久没有截取nginx/haproxy 中 的日志了,竟有点不熟悉了. 记录一下,以免以后忘记. NGINX 日志格式: 192.168.1.26 - - [14/Sep/2017:16:48:42 ...

  9. codeforces 963A Alternating Sum

    codeforces 963A Alternating Sum 题解 计算前 \(k\) 项的和,每 \(k\) 项的和是一个长度为 \((n+1)/k\) ,公比为 \((a^{-1}b)^k\) ...

  10. Linux下中间人攻击利用框架bettercap测试

    0x01简介 bettercap可用来实现各种中间人攻击,模块化,便携.易扩展 0x02特点 提到中间人攻击,最知名的莫过于ettercap,而开发bettercap的目的不是为了追赶它,而是替代它 ...