完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛扫一扫,分享给好友
|
我使用的是CYW43907,特别是纳秒时钟功能:
UIT64 64 WITEDGETGETA NoSnOxEndoCdCl值(空隙); 空隙; 空隙; 空隙; 但是,顶端一个返回UIT64 64 t,为了打印它,我必须在打印函数中使用正确的占位符,如下所示: 包括: […] UIT64 64纳米=4294967295; WPrPtTrAppAppIn((%)PiRu64“n,Nano”); […] 然而,函数返回0或1610612819,这使我相信定义UtiN 64的方法是导致问题的原因。这个堆栈溢出线程STNIDT——如何在C堆栈溢出中打印一个It64的T类型是我使用PrIU64的基础。我也尝试铸造纳米作为一个(无符号长long int)没有用。 以前有人处理过这个问题吗?是否有可用的函数打印UIT64 64 T?我应该使用一个不同的类型或方法吗? 谢谢 以上来自于百度翻译 以下为原文 I am using a CYW43907, specifically the nanosecond clock functions: uint64_t wiced_get_nanosecond_clock_value( void ); void wiced_deinit_nanosecond_clock( void ); void wiced_reset_nanosecond_clock( void ); void wiced_init_nanosecond_clock( void ); However the top one returns a uint64_t and in order to print it I must use the correct placeholder within the print function as seen below: #include [...] uint64_t nano = 4294967295; WPRINT_APP_INFO(("%"PRIu64"n", nano)); [...] However the function either returns 0 or 1610612819 which leads me to believe the way uint64_t is defined is what is causing the problem. This stack overflow thread stdint - How to print a int64_t type in C - Stack Overflow is the basis for my use of PRIu64. I also tried casting nano as a (unsigned long long int) to no avail. Has anyone dealt with this problem before? Is there an available function to print a uint64_t? Should I be using a different typecast or approach altogether? Thanks |
|
相关推荐
5个回答
|
|
|
我可以打印WEX值使用WPRINTHYAPAPIOFING((打印纳米:%x%xn),*(((int *)(&纳米)+ 1),纳米))。我将尝试找出打印int的方法。
以上来自于百度翻译 以下为原文 I could print the hex value by using WPRINT_APP_INFO((" print nano: %x%xn", *(((int*)(&nano ))+1), nano )). I will try to figure out the way to print int meanwhile. |
|
|
|
|
|
嗨,我已经能够使用你的代码打印十六进制值。几个问题: 1)为什么你首先打印数字的最小一半? 2)我们可以期待什么样的精度与这个时钟?我们试着用16微秒的延迟时间,用纳秒时钟得到1800微秒的输出。 我真的很感激能打印出int的代码。 谢谢您!! 以上来自于百度翻译 以下为原文 Hi I've been able to use your code to print hex values. A few questions: 1) why do you print the least significant half of the numbers first? 2) What accuracy can we expect with this clock? We are trying to time a 16 microsecond delay and have gotten ~1800 microseconds as an output using the nanosecond clock. I'd really appreciate the code to print out the int still Thank you!! |
|
|
|
|
徐红wendyxu 发表于 2018-12-28 13:44 你好, 打印UTIN 64位的十进制值有进展吗?我正在处理同样的问题,非常感谢你们的帮助。 谢谢你的时间! 以上来自于百度翻译 以下为原文 Hi, Have you made progress printing the decimal value of the uint64_t? I am dealing with the same issue and would greatly appreciate the help. Thanks for your time! |
|
|
|
|
|
HI,您可以通过键入它来打印int值并使用浮点标识符,即WPRINTHYAPAPIOFING((“%F”,(双)纳米)); 按照我的理解,这个数字是用正确的格式打印出来的。最不重要的一半不先打印。 你能在第二个问题上详细阐述一下吗?根据应用程序的核心频率为3MHz,你应该能够延迟16微秒。 以上来自于百度翻译 以下为原文 Hi, You can print the int value by typecasting it to double and using the float identifier i.e., WPRINT_APP_INFO((" %f", (double)nano)); As per my understanding, the number is printed in correct format. The least significant half is not printed first. Can you elaborate a bit on the second question? As per the apps core frequency of 320Mhz, you should be able to get delay of 16microseconds. |
|
|
|
|
徐红wendyxu 发表于 2018-12-28 14:15 Riya是对的…但这似乎是一个错误的WICE,应该是固定的。 参见下面的“C”MAC桌面比较 事业单位 企业的价值源泉 事业单位 包括“W.H.” 空隙应用程序启动() { /W*初始化Wice设备*/ /LED在平台上初始化。如果不是,你需要如下: //WICEDESGPIOXIIIT(WICDEDLID1,OutPuthPurth-Pay-Load);*/ Char * TimeYC=“1522462712511”; WPrimtTyAppInFipe((-----字符串时间:-[%s] n),TimeY-C); 无符号长长时间= Strutl(TimeAuthC,NULL,10); W-PrimtLaPAPIOFIN((-----)长LX:(f铸造为double)-[[%f] n,(double)时间); WpPrimtAppAppIn((----- -long long X:(LD铸造为长)-[-%Ld] n,(long)time)); WINPINTHAPAPIOFINFO((-----)长LX:(D铸造为int)----[%D] n,(int)时间); W-PrimtTyAppInFipe((----- -LealLangx:x(-x)-----------[%x] n,time)); WpPrimtAppAppInf((----- -LealLangx:LLU)---------[%LLU\n,时间); } 企业的产出 启动WICEDYE0.60.1.0.0.0.85 CYW943907AEVAL1F平台初始化 启动th5.x v5.8 初始化NETXX-DUO V5.10Sp3 创建包池 无线局域网MAC地址:A4:08:EA:D9:C1: CC WLAN固件:WL0: 2月12日2018 23:35:27版本7.15168108(R68 38 13)FWID 01-81FD72AF WLAN CLM:API:12.2数据:91.774编译器:1.31.3CLMIPION:1.33.3创建:2018-02-1223:30:46 -----弦乐时间:-----〔1522462712511〕 ----长隆X:(F投双)-----〔1522462712511 000000〕 ----长隆X:(LD铸长)----[ 2044289727 ] --------------------------------------(2044289727) ----------------------------------[4B5FF8] --------------------------------------------------------------------------------------------------〔4939818〕 事业单位 Mac上写的比较“C”源 事业单位 包含和lt;Stdio.h & gt;/*PrimTf,NUL*// 包含和lt;STDLIB。 In main() { /LED在平台上初始化。如果不是,你需要如下: //WICEDESGPIOXIIIT(WICDEDLID1,OutPuthPurth-Pay-Load);*/ Char * TimeYC=“1522462712511”; PrimTf(“-----字符串时间:-[[%s] n”,TimeY-C); 无符号长长时间= Strutl(TimeAuthC,NULL,10); (-----长隆X:(F铸双)-[%f] n,(双)时间); PrimTf(“-long long X:(LD铸造为长)-[-%Ld] n),(long)时间); PrINTF(“-----长隆X:(D铸为int)---[%D] n”,(int)时间; (-----长隆X:(x)-----------[%x] n,时间; (-----长隆X:(LLU)------------[%LLU\n”,时间); } 企业的“C”产出 $/Testoul -----弦乐时间:-----〔1522462712511〕 ----长隆X:(F投双)-----〔1522462712511 000000〕 ----长隆X:(LD铸长)----[ 1522462712511 ] --------------------------------------(2044289727) ----------------------------------[79D962BF] --------------------------------------------------------------------------------------------------〔1522462712511〕 以上来自于百度翻译 以下为原文 Riya was right.... but this seems like a bug on WICED that should be fixed. See the "C" Mac desktop comparison below ============================================ ============== WICED Source: ================= ============================================ #include "wiced.h" void application_start( ) { wiced_init(); /* Initialize the WICED device */ //The LED is initialized in platform.c. If it was not, you would need the following: //wiced_gpio_init(WICED_LED1, OUTPUT_PUSH_PULL); */ char *time_c = "1522462712511"; WPRINT_APP_INFO(( "----- String time: ----- [%s]n ", time_c)); unsigned long long time = strtoull(time_c, NULL, 10); WPRINT_APP_INFO(( "----- long long x: (f cast as double)----- [%f]n ", (double)time)); WPRINT_APP_INFO(( "----- long long x: (ld cast as long)------ [%ld]n ", (long)time)); WPRINT_APP_INFO(( "----- long long x: (d cast as int)-------- [%d]n ", (int)time)); WPRINT_APP_INFO(( "----- long long x: (x)-------------------- [%x]n ", time)); WPRINT_APP_INFO(( "----- long long x: (llu)------------------ [%llu]n ", time)); } ============== Output: ================= Starting WICED Wiced_006.001.000.0085 Platform CYW943907AEVAL1F initialised Started ThreadX v5.8 Initialising NetX_Duo v5.10_sp3 Creating Packet pools WLAN MAC Address : A4:08:EA:D9:C1:CC WLAN Firmware : wl0: Feb 12 2018 23:35:27 version 7.15.168.108 (r683813) FWID 01-81fd72af WLAN CLM : API: 12.2 Data: 9.10.74 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2018-02-12 23:30:46 ----- String time: ----- [1522462712511] ----- long long x: (f cast as double)----- [1522462712511.000000] ----- long long x: (ld cast as long)------ [2044289727] ----- long long x: (d cast as int)-------- [2044289727] ----- long long x: (x)-------------------- [4b5ff8] ----- long long x: (llu)------------------ [4939818] ======================================================== ======= Comparison "C" Source Written on Mac: ================= ======================================================== #include #include int main () { //The LED is initialized in platform.c. If it was not, you would need the following: //wiced_gpio_init(WICED_LED1, OUTPUT_PUSH_PULL); */ char *time_c = "1522462712511"; printf( "----- String time: ----- [%s]n ", time_c); unsigned long long time = strtoull(time_c, NULL, 10); printf( "----- long long x: (f cast as double)----- [%f]n ", (double)time); printf( "----- long long x: (ld cast as long)------ [%ld]n ", (long)time); printf( "----- long long x: (d cast as int)-------- [%d]n ", (int)time); printf( "----- long long x: (x)-------------------- [%x]n ", time); printf( "----- long long x: (llu)------------------ [%llu]n ", time); } ============== Mac "C" Output: ================= $ ./testull ----- String time: ----- [1522462712511] ----- long long x: (f cast as double)----- [1522462712511.000000] ----- long long x: (ld cast as long)------ [1522462712511] ----- long long x: (d cast as int)-------- [2044289727] ----- long long x: (x)-------------------- [79d962bf] ----- long long x: (llu)------------------ [1522462712511] |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7088 浏览 0 评论
2474 浏览 1 评论
2166 浏览 1 评论
4031 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2073 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7567浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6114浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
742浏览 2评论
710浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7962浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 08:51 , Processed in 2.426414 second(s), Total 80, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1470