1
0
Fork 0
This commit is contained in:
Jack Humbert 2014-12-11 17:36:42 -05:00
parent 1c6770f18c
commit d9a1b9086f
6 changed files with 40 additions and 49 deletions

View file

@ -22,13 +22,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void led_set(uint8_t usb_led)
{
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// output low
DDRB |= (1<<2);
PORTB &= ~(1<<2);
if (usb_led & (1<<USB_LED_FUNCTION)) {
// Output high.
DDRF |= (1<<0);
PORTF |= (1<<0);
} else {
// Hi-Z
DDRB &= ~(1<<2);
PORTB &= ~(1<<2);
// Output low.
DDRF &= ~(1<<0);
PORTF &= ~(1<<0);
}
}