<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/10192" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2015-12-26T12:44:56+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/10192</id>

		<entry>
		<author><name><![CDATA[Davo]]></name></author>
		<updated>2015-12-26T12:44:56+02:00</updated>

		<published>2015-12-26T12:44:56+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10192&amp;p=30660#p30660</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10192&amp;p=30660#p30660"/>
		<title type="html"><![CDATA[Re: v-usb and matrix led hangups]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10192&amp;p=30660#p30660"><![CDATA[
I'm going to chalk this up to late night blundering.  I managed to get the avr to behave as expected.  Still some testing.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=21755">Davo</a> — Sat Dec 26, 2015 12:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Davo]]></name></author>
		<updated>2015-12-24T05:58:33+02:00</updated>

		<published>2015-12-24T05:58:33+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10192&amp;p=30650#p30650</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10192&amp;p=30650#p30650"/>
		<title type="html"><![CDATA[v-usb and matrix led hangups]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10192&amp;p=30650#p30650"><![CDATA[
I'm trying to accept up to eight bytes through a USB port and display them on an 8x8 matrix controlled by a MAX7219.  With some slight modifications to the hid-data example, I managed to do this.  When I send bytes to the 328p, the display updates instantly, but then hidtool hangs like this for about five seconds:<br /><br /><div class="codebox"><p>Code: </p><pre><code>$ sudo ./hidtool write 0x66,0x66<br />Error sending message: Connection timed out<br />error writing data: Communication error with device</code></pre></div><br /><br />Here are the changes I made to the hid-data example main.c:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#include &quot;ledmatrix7219d88.h&quot;<br />uint8_t rows&#91;8&#93;;<br />...<br />uchar   usbFunctionWrite(uchar *data, uchar len)<br />{<br />    uchar i;<br /><br />    if (len &gt; bytesRemaining)<br />        len = bytesRemaining;<br />    bytesRemaining -= len;<br />    for (i = 0; i &lt; len; i++)<br />        rows&#91;currentAddress++&#93; = data&#91;i&#93;;<br />    return bytesRemaining;<br />}<br />...<br />usbMsgLen_t usbFunctionSetup(uchar data&#91;8&#93;)<br />{<br />    usbRequest_t    *rq = (void *)data;<br /><br />    if((rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){    /* HID class request */<br />        if(rq-&gt;bRequest == USBRQ_HID_GET_REPORT){  /* wValue: ReportType (highbyte), ReportID (lowbyte) */<br />            /* since we have only one report type, we can ignore the report-ID */<br />            bytesRemaining = 8;<br />            currentAddress = 0;<br />            return USB_NO_MSG;  /* use usbFunctionRead() to obtain data */<br />        }else if(rq-&gt;bRequest == USBRQ_HID_SET_REPORT){<br />            /* since we have only one report type, we can ignore the report-ID */<br />            bytesRemaining = 8;<br />            currentAddress = 0;<br />            return USB_NO_MSG;  /* use usbFunctionWrite() to receive data from host */<br />        }<br />    }else{<br />        /* ignore vendor type requests, we don't use any */<br />    }<br />    return 0;<br />}<br />...<br />ledmatrix7219d88_setmatrix(0, rows); /*this one added right after the call to usbPoll() in main() */<br /></code></pre></div><br /><br />What am I doing wrong?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=21755">Davo</a> — Thu Dec 24, 2015 5:58 am</p><hr />
]]></content>
	</entry>
	</feed>
