#include "profile.h"
#include "usb.h"
#include "led.h"
Go to the source code of this file.
|
static int | hwloadmode (usbdevice *kb, hwprofile *hw, int mode) |
|
int | cmd_hwload_kb (usbdevice *kb, usbmode *dummy1, int dummy2, int apply, const char *dummy3) |
|
int | cmd_hwsave_kb (usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4) |
|
int cmd_hwload_kb |
( |
usbdevice * |
kb, |
|
|
usbmode * |
dummy1, |
|
|
int |
dummy2, |
|
|
int |
apply, |
|
|
const char * |
dummy3 |
|
) |
| |
Definition at line 16 of file profile_keyboard.c.
References DELAY_LONG, usbdevice::hw, hwloadmode(), HWMODE_K70, HWMODE_K95, hwtonative(), hwprofile::id, IS_K95, MSG_SIZE, hwprofile::name, PR_NAME_LEN, usbdevice::profile, and usbrecv.
25 { 0x0e, 0x15, 0x01, 0 },
26 { 0x0e, 0x16, 0x01, 0 }
30 for(
int i = 0; i <= modes; i++){
32 if(!
usbrecv(kb, data_pkt[0], in_pkt)){
36 memcpy(hw->
id + i, in_pkt + 4,
sizeof(
usbid));
39 if(!
usbrecv(kb, data_pkt[1], in_pkt)){
45 for(
int i = 0; i < modes; i++){
#define DELAY_LONG(kb)
The longest delay takes place where something went wrong (eg when resetting the device) ...
void hwtonative(usbprofile *profile, hwprofile *hw, int modecount)
static int hwloadmode(usbdevice *kb, hwprofile *hw, int mode)
#define usbrecv(kb, out_msg, in_msg)
usbrecv macro is used to wrap _usbrecv() with debugging information (file and lineno) ...
int cmd_hwsave_kb |
( |
usbdevice * |
kb, |
|
|
usbmode * |
dummy1, |
|
|
int |
dummy2, |
|
|
int |
dummy3, |
|
|
const char * |
dummy4 |
|
) |
| |
Definition at line 61 of file profile_keyboard.c.
References DELAY_LONG, usbdevice::hw, HWMODE_K70, HWMODE_K95, hwprofile::id, IS_K95, hwprofile::light, MD_NAME_LEN, MSG_SIZE, hwprofile::name, nativetohw(), usbdevice::profile, savergb_kb(), and usbsend.
75 { 0x07, 0x16, 0x01, 0 },
76 { 0x07, 0x15, 0x01, 0 },
79 for(
int i = 0; i <= modes; i++){
82 if(!
usbsend(kb, data_pkt[0], 1))
86 for(
int i = 0; i <= modes; i++){
88 memcpy(data_pkt[1] + 4, hw->
id + i,
sizeof(
usbid));
89 if(!
usbsend(kb, data_pkt[1], 1))
93 for(
int i = 0; i < modes; i++){
#define DELAY_LONG(kb)
The longest delay takes place where something went wrong (eg when resetting the device) ...
void nativetohw(usbprofile *profile, hwprofile *hw, int modecount)
int savergb_kb(usbdevice *kb, lighting *light, int mode)
#define usbsend(kb, messages, count)
usbsend macro is used to wrap _usbsend() with debugging information (file and lineno) ...
Definition at line 5 of file profile_keyboard.c.
References hwprofile::light, loadrgb_kb(), MD_NAME_LEN, MSG_SIZE, hwprofile::name, and usbrecv.
Referenced by cmd_hwload_kb().
9 if(!
usbrecv(kb, data_pkt, in_pkt))
int loadrgb_kb(usbdevice *kb, lighting *light, int mode)
#define usbrecv(kb, out_msg, in_msg)
usbrecv macro is used to wrap _usbrecv() with debugging information (file and lineno) ...