Mercurial > louis > kiibohd-controller
comparison Output/pjrcUSB/arm/usb_desc.c @ 420:23a1868b4ac2
Adding dynamic USB power support
- Each scan module now has a current change callback which passes the available current as a parameter
- No longer attempts to use the max 500 mA immediately, starts with 100 mA then goes to 500 mA after enumeration
- If enumeration fails due to bMaxPower of 500 mA, then attempt again at 100 mA (might also be possible to go even lower to 20 mA in certain cases)
- Now working with the Apple Ipad (no over-power messages)
- Fixed Wake-up behaviour on Apple Ipad (and likely other iOS devices)
- More effecient set_feature/clear_feature handling (device handler)
- Initial power handling via Interconnect (still needs work to get it more dynamic)
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sun, 21 Feb 2016 19:56:52 -0800 |
parents | 36b047a5afb0 |
children | 970dab727f47 |
comparison
equal
deleted
inserted
replaced
419:910be0f02758 | 420:23a1868b4ac2 |
---|---|
1 /* Teensyduino Core Library | 1 /* Teensyduino Core Library |
2 * http://www.pjrc.com/teensy/ | 2 * http://www.pjrc.com/teensy/ |
3 * Copyright (c) 2013 PJRC.COM, LLC. | 3 * Copyright (c) 2013 PJRC.COM, LLC. |
4 * Modified by Jacob Alexander (2013-2015) | 4 * Modified by Jacob Alexander (2013-2016) |
5 * | 5 * |
6 * Permission is hereby granted, free of charge, to any person obtaining | 6 * Permission is hereby granted, free of charge, to any person obtaining |
7 * a copy of this software and associated documentation files (the | 7 * a copy of this software and associated documentation files (the |
8 * "Software"), to deal in the Software without restriction, including | 8 * "Software"), to deal in the Software without restriction, including |
9 * without limitation the rights to use, copy, modify, merge, publish, | 9 * without limitation the rights to use, copy, modify, merge, publish, |
449 MSB(CONFIG_DESC_SIZE), | 449 MSB(CONFIG_DESC_SIZE), |
450 NUM_INTERFACE, // bNumInterfaces | 450 NUM_INTERFACE, // bNumInterfaces |
451 1, // bConfigurationValue | 451 1, // bConfigurationValue |
452 0, // iConfiguration | 452 0, // iConfiguration |
453 0xA0, // bmAttributes | 453 0xA0, // bmAttributes |
454 250, // bMaxPower | 454 250, // bMaxPower - Entry Index 8 |
455 | 455 |
456 // --- Keyboard HID --- Boot Mode Keyboard Interface | 456 // --- Keyboard HID --- Boot Mode Keyboard Interface |
457 // - 9 bytes - | 457 // - 9 bytes - |
458 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 | 458 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 |
459 9, // bLength | 459 9, // bLength |
693 0x03, // bmAttributes (0x03=intr) | 693 0x03, // bmAttributes (0x03=intr) |
694 SYS_CTRL_SIZE, 0, // wMaxPacketSize | 694 SYS_CTRL_SIZE, 0, // wMaxPacketSize |
695 SYS_CTRL_INTERVAL, // bInterval | 695 SYS_CTRL_INTERVAL, // bInterval |
696 }; | 696 }; |
697 | 697 |
698 uint8_t *usb_bMaxPower = &config_descriptor[8]; | |
699 | |
698 | 700 |
699 | 701 |
700 // ----- String Descriptors ----- | 702 // ----- String Descriptors ----- |
701 | 703 |
702 // The descriptors above can provide human readable strings, | 704 // The descriptors above can provide human readable strings, |