Skip to content

Commit

Permalink
hardware, test
Browse files Browse the repository at this point in the history
  • Loading branch information
crides committed Dec 31, 2023
1 parent 2f43fb5 commit 5c64a37
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 48 deletions.
2 changes: 1 addition & 1 deletion app/boards/arm/fissure/fissure_left.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ PIX(1, 0) PIX(2, 0) PIX(0, 2) PIX(0, 4) PIX(2, 2) PIX(3, 2)
};

&rgb {
sdb-gpios = <&gpio0 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
sdb-gpios = <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
};

&spi1 {
Expand Down
2 changes: 1 addition & 1 deletion app/boards/arm/fissure/fissure_right.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PIX(3, 4) PIX(2, 4) PIX(1, 4)
compatible = "pixart,pmw3610";
status = "okay";
reg = <1>;
spi-max-frequency = <2000000>;
spi-max-frequency = <1500000>;
irq-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
rst-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
};
Expand Down
4 changes: 3 additions & 1 deletion app/boards/arm/fissure/fissure_right_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ CONFIG_IS31FL3729=y

CONFIG_ZMK_MOUSE=y
CONFIG_PMW3610=y
# CONFIG_PINNACLE=y
# CONFIG_PINNACLE_TRIGGER_GLOBAL_THREAD=y

CONFIG_PINCTRL=y
CONFIG_NFCT_PINS_AS_GPIOS=y

CONFIG_ZMK_LOG_LEVEL_INF=y
# CONFIG_ZMK_LOG_LEVEL_INF=y
CONFIG_LOG=y
CONFIG_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y
Expand Down
2 changes: 1 addition & 1 deletion app/boards/arm/fissure/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void handle_mouse(const struct device *dev, const struct sensor_trigger *
/* } */
/* } */
/* if (update) { */
zmk_hid_mouse_movement_set(dx.val1, dy.val1);
zmk_hid_mouse_movement_set(-dy.val1, dx.val1);
/* } */
/* button = LCLK; */
/* } */
Expand Down
53 changes: 9 additions & 44 deletions app/src/led_widgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <zephyr/logging/log.h>
#include <zephyr/drivers/led_strip.h>

LOG_MODULE_REGISTER(led_widgets, 4);
LOG_MODULE_REGISTER(led_widgets, 2);

static const struct device *leds = DEVICE_DT_GET(DT_CHOSEN(zmk_led_widgets_dev));
extern const led_widget_t led_widgets[LED_EVENT_SIZE][CONFIG_ZMK_LED_WIDGETS_MAX_WIDGET_NUM];
Expand Down Expand Up @@ -183,49 +183,14 @@ static int led_widgets_event_listener(const zmk_event_t *ev) {
}

static int led_widgets_init() {
struct led_rgb pixels[] = {
/* { .r = 13, .g = 59, .b = 0 }, */
/* { .r = 26, .g = 59, .b = 0 }, */
/* { .r = 38, .g = 59, .b = 0 }, */
/* { .r = 51, .g = 59, .b = 0 }, */
/* { .r = 64, .g = 59, .b = 0 }, */
/* { .r = 77, .g = 59, .b = 0 }, */
/* { .r = 89, .g = 59, .b = 0 }, */
/* { .r = 102, .g = 59, .b = 0 }, */
/* { .r = 115, .g = 59, .b = 0 }, */
/* { .r = 128, .g = 59, .b = 0 }, */
/* { .r = 140, .g = 59, .b = 0 }, */
/* { .r = 153, .g = 59, .b = 0 }, */
/* { .r = 166, .g = 59, .b = 0 }, */
/* { .r = 179, .g = 59, .b = 0 }, */
/* { .r = 191, .g = 59, .b = 0 }, */
/* { .r = 204, .g = 59, .b = 0 }, */
/* { .r = 217, .g = 59, .b = 0 }, */
/* { .r = 230, .g = 59, .b = 0 }, */
/* { .r = 242, .g = 59, .b = 0 }, */
/* { .r = 255, .g = 59, .b = 0 }, */

{ .r = 255, .g = 0, .b = 0, },
{ .r = 255, .g = 77, .b = 0, },
{ .r = 255, .g = 153, .b = 0, },
{ .r = 255, .g = 230, .b = 0, },
{ .r = 204, .g = 255, .b = 0, },
{ .r = 128, .g = 255, .b = 0, },
{ .r = 51, .g = 255, .b = 0, },
{ .r = 0, .g = 255, .b = 26, },
{ .r = 0, .g = 255, .b = 102, },
{ .r = 0, .g = 255, .b = 179, },
{ .r = 0, .g = 255, .b = 255, },
{ .r = 0, .g = 178, .b = 255, },
{ .r = 0, .g = 102, .b = 255, },
{ .r = 0, .g = 25, .b = 255, },
{ .r = 51, .g = 0, .b = 255, },
{ .r = 128, .g = 0, .b = 255, },
{ .r = 204, .g = 0, .b = 255, },
{ .r = 255, .g = 0, .b = 229, },
{ .r = 255, .g = 0, .b = 153, },
{ .r = 255, .g = 0, .b = 76, },
};
struct led_rgb pixels[20] = {0};
pixels[
#if !IS_ENABLED(CONFIG_ZMK_SPLIT) || IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
17
#else
19
#endif
].g = 4;
led_strip_update_rgb(leds, pixels, 20);
for (uint8_t i = 0; i < LED_EVENT_SIZE; i++) {
active_widgets_ind[i] = -1;
Expand Down

0 comments on commit 5c64a37

Please sign in to comment.