Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken getLEDstate #14

Merged
merged 1 commit into from
Mar 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions TrinketHidCombo/TrinketHidComboC.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ usbMsgLen_t usbFunctionSetup(uint8_t data[8])
if (rq->wValue.bytes[0] == REPID_SYSCTRLKEY) return REPSIZE_SYSCTRLKEY;
return 8; // default
case USBRQ_HID_SET_REPORT:
if (rq->wLength.word == 1) // check data is available
if (rq->wLength.word == 2) // check data is available
{
// 1 byte, we don't check report type (it can only be output or feature)
// 1st is the report byte, data is the 2nd byte.
// We don't check report type (it can only be output or feature)
// we never implemented "feature" reports so it can't be feature
// so assume "output" reports
// this means set LED status
Expand All @@ -232,7 +233,8 @@ usbMsgLen_t usbFunctionSetup(uint8_t data[8])
// see http://vusb.wikidot.com/driver-api
usbMsgLen_t usbFunctionWrite(uint8_t * data, uchar len)
{
led_state = data[0];
//We take the 2nd byte, which is the data byte
led_state = data[1];
return 1; // 1 byte read
}

Expand Down Expand Up @@ -291,4 +293,4 @@ For version 5.x RC oscillators (those with a split range of 2x128 steps, e.g.
ATTiny25, ATTiny45, ATTiny85), it may be useful to search for the optimum in
both regions.
*/
#endif
#endif