forked from mirrors/qmk_userspace
Fix Phantom sleep LED.
This commit is contained in:
parent
9e84c89535
commit
28aeef231b
3 changed files with 35 additions and 12 deletions
|
@ -16,19 +16,34 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
#include "stdint.h"
|
||||
#include "led.h"
|
||||
|
||||
|
||||
void led_set(uint8_t usb_led)
|
||||
{
|
||||
if (!(usb_led & (1<<USB_LED_CAPS_LOCK)))
|
||||
DDRB &= ~(1<<6);
|
||||
else
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK))
|
||||
{
|
||||
// Output high.
|
||||
DDRB |= (1<<6);
|
||||
|
||||
if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)))
|
||||
DDRB &= ~(1<<7);
|
||||
PORTB |= (1<<6);
|
||||
}
|
||||
else
|
||||
DDRB |= (1<<7);
|
||||
{
|
||||
// Output low.
|
||||
DDRB &= ~(1<<6);
|
||||
PORTB &= ~(1<<6);
|
||||
}
|
||||
|
||||
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
|
||||
{
|
||||
// Output high.
|
||||
DDRB &= ~(1<<7);
|
||||
PORTB |= (1<<7);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Output low.
|
||||
DDRB &= ~(1<<7);
|
||||
PORTB &= ~(1<<7);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue