driver: asset interface

master
vhaudiquet 1 year ago
parent 5b78a431e0
commit 252206764b
  1. 4
      drivers/Makefile
  2. 4
      drivers/g-wolves/htx/Makefile
  3. 6
      drivers/g-wolves/htx/htx.c

@ -1,7 +1,7 @@
SUBDIRS := $(wildcard */.)
BUILD_DIR=../build/
all: $(BUILD_DIR)/drivers/ $(SUBDIRS)
all: $(BUILD_DIR)/drivers/ $(BUILD_DIR)/drivers/assets/ $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
@ -10,3 +10,5 @@ $(SUBDIRS):
$(BUILD_DIR)/drivers/:
mkdir -p $(BUILD_DIR)/drivers/
$(BUILD_DIR)/drivers/assets/:
mkdir -p $(BUILD_DIR)/drivers/assets/

@ -7,4 +7,6 @@ BUILD_DIR=../../../build/
all: $(BUILD_DIR)/drivers/gwolves-htx.so
$(BUILD_DIR)/drivers/gwolves-htx.so: htx.c | $(BUILD_DIR)/drivers/
gcc $(CFLAGS) -o $@ $^
$(CC) $(CFLAGS) -o $@ $^
$(BUILD_DIR)/drivers/assets/gwolves-htx.png: htx_0.png | $(BUILD_DIR)/drivers/assets
cp $^ $@

@ -13,7 +13,7 @@ static int htx_send_command(libusb_device_handle* hand, uint8_t command, uint8_t
0x300, // wValue (FEATURE << 8 | REPORT(0))
0x2, // wIndex = 0x2 : interface
report,
64, // wLength = 64
REPORT_MAX_SIZE, // wLength = 64
0 /* timeout*/);
if(res <= 0) return res;
@ -25,7 +25,7 @@ static int htx_send_command(libusb_device_handle* hand, uint8_t command, uint8_t
0x300, // wValue (FEATURE << 8 | REPORT(0))
0x2, // wIndex = 0x2 : interface
report,
64, // wLength = 64
REPORT_MAX_SIZE, // wLength = 64
0);
return res;
@ -65,5 +65,5 @@ char* driver_get_name(void* handle)
char* driver_get_image(void* handle)
{
return "drivers/g-wolves/htx/htx_0.png";
return "drivers/assets/gwolves-htx.png";
}

Loading…
Cancel
Save