forked from mirrors/qmk_userspace
New and improved lock LED callbacks (#7215)
* New and improved lock LED callbacks * Include stdbool * Update documentation * Use full function signatures and add keyboard-level example
This commit is contained in:
parent
ed0575fc8a
commit
dfb78d2a08
9 changed files with 142 additions and 70 deletions
|
@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef LED_H
|
||||
#define LED_H
|
||||
#include "stdint.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
/* FIXME: Add doxygen comments here. */
|
||||
|
||||
|
@ -32,6 +33,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef union {
|
||||
uint8_t raw;
|
||||
struct {
|
||||
bool num_lock : 1;
|
||||
bool caps_lock : 1;
|
||||
bool scroll_lock : 1;
|
||||
bool compose : 1;
|
||||
bool kana : 1;
|
||||
uint8_t reserved : 3;
|
||||
};
|
||||
} led_t;
|
||||
|
||||
void led_set(uint8_t usb_led);
|
||||
|
||||
void led_init_ports(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue