极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11130|回复: 2

arduino hrNAK是什么

[复制链接]
发表于 2013-4-18 15:02:26 | 显示全部楼层 |阅读模式
本帖最后由 orphenleoli 于 2013-4-18 16:24 编辑

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

使用道具 举报

发表于 2013-4-18 16:05:00 | 显示全部楼层
本帖最后由 histamine 于 2013-4-18 16:11 编辑

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


https://github.com/felis/USB_Hos ... b/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页

0x04  hrNAK       Peripheral returned NAK

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

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


建议LZ下次问问题把代码全部贴出来
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-4-18 16:18:12 | 显示全部楼层
histamine 发表于 2013-4-18 16:05
幸好google比较给力,搜到了代码出处


非常感谢,你的建议我一定会注意的。
回复 支持 反对

使用道具 举报

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

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-5 02:21 , Processed in 0.035616 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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