Skip to content

Commit

Permalink
Move some non-public defines back to .c
Browse files Browse the repository at this point in the history
caksoylar committed Aug 20, 2024
1 parent 3c66741 commit 281e00d
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 0 additions & 20 deletions include/zmk_rgbled_widget/widget.h
Original file line number Diff line number Diff line change
@@ -2,26 +2,6 @@
(IS_ENABLED(CONFIG_RGBLED_WIDGET_SHOW_LAYER_CHANGE)) && \
(!IS_ENABLED(CONFIG_ZMK_SPLIT) || IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL))

// color values as specified by an RGB bitfield
enum led_color_t {
LED_BLACK, // 0b000
LED_RED, // 0b001
LED_GREEN, // 0b010
LED_YELLOW, // 0b011
LED_BLUE, // 0b100
LED_MAGENTA, // 0b101
LED_CYAN, // 0b110
LED_WHITE // 0b111
};

// a blink work item as specified by the color and duration
struct blink_item {
enum led_color_t color;
uint16_t duration_ms;
bool first_item;
uint16_t sleep_ms;
};

#if IS_ENABLED(CONFIG_ZMK_BATTERY_REPORTING)
void indicate_battery(void);
#endif
20 changes: 20 additions & 0 deletions src/widget.c
Original file line number Diff line number Diff line change
@@ -35,6 +35,26 @@ static const uint8_t rgb_idx[] = {DT_NODE_CHILD_IDX(DT_ALIAS(led_red)),
DT_NODE_CHILD_IDX(DT_ALIAS(led_green)),
DT_NODE_CHILD_IDX(DT_ALIAS(led_blue))};

// color values as specified by an RGB bitfield
enum led_color_t {
LED_BLACK, // 0b000
LED_RED, // 0b001
LED_GREEN, // 0b010
LED_YELLOW, // 0b011
LED_BLUE, // 0b100
LED_MAGENTA, // 0b101
LED_CYAN, // 0b110
LED_WHITE // 0b111
};

// a blink work item as specified by the color and duration
struct blink_item {
enum led_color_t color;
uint16_t duration_ms;
bool first_item;
uint16_t sleep_ms;
};

// flag to indicate whether the initial boot up sequence is complete
static bool initialized = false;

0 comments on commit 281e00d

Please sign in to comment.