orphenleoli 发表于 2013-4-18 15:02:26

arduino hrNAK是什么

本帖最后由 orphenleoli 于 2013-4-18 16:24 编辑

请问 if(rcode && rcode != hrNAK) 这句中 hrNAK是指的什么,是常量吗?这个判断是什么意思呢?

histamine 发表于 2013-4-18 16:05:00

本帖最后由 histamine 于 2013-4-18 16:11 编辑

幸好google比较给力,搜到了代码出处


https://github.com/felis/USB_Host_Shield_2.0/blob/master/max3421e.h
211行 /* Host error result codes, the 4 LSB's in the HRSL register */
216行 #define hrNAK       0x04

然后再看MAX3421E Programming Guide
http://pdfserv.maximintegrated.com/en/an/AN3785.pdf
第10页

0x04hrNAK       Peripheral returned NAK

最后搜一下usb协议里面NAK的定义


NAK - Reports that the device temporary cannot send or received data.


建议LZ下次问问题把代码全部贴出来:lol

orphenleoli 发表于 2013-4-18 16:18:12

histamine 发表于 2013-4-18 16:05 static/image/common/back.gif
幸好google比较给力,搜到了代码出处




非常感谢,你的建议我一定会注意的。
页: [1]
查看完整版本: arduino hrNAK是什么