Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
simon-wh committed Oct 20, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 8500fad + cd7b329 commit c014b40
Showing 2 changed files with 24 additions and 5 deletions.
3 changes: 1 addition & 2 deletions mac/Makefile
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ clean:
rm -f $(OBJS)

install: libwooting-rgb-sdk.dylib
cp libwooting-rgb-sdk.dylib /usr/local/libwooting-rgb-sdk.dylib
cp libwooting-rgb-sdk.pc /usr/local/pkgconfig/libwooting-rgb-sdk.pc
cp libwooting-rgb-sdk.dylib /usr/local/lib/libwooting-rgb-sdk.dylib

.PHONY: clean libs
26 changes: 23 additions & 3 deletions src/wooting-rgb-sdk.c
Original file line number Diff line number Diff line change
@@ -31,6 +31,26 @@ static bool rgb_buffer2_changed = false;
static bool rgb_buffer3_changed = false;
static bool rgb_buffer4_changed = false;

static uint8_t gammaFilter[256] = {
0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8,
9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11,
12, 12, 13, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18,
18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 22, 22, 23, 24,
24, 25, 25, 26, 26, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32,
33, 34, 35, 35, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 43,
44, 44, 45, 45, 46, 47, 48, 49, 50, 50, 51, 51, 52, 52, 53,
54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61,
61, 62, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89, 90, 92, 93, 95,
96, 98, 99, 101, 102, 104, 105, 107, 109, 110, 112, 114, 115, 117, 119,
120, 122, 124, 126, 127, 129, 131, 133, 135, 137, 138, 140, 142, 144, 146,
148, 150, 152, 154, 156, 158, 160, 162, 164, 167, 169, 171, 173, 175, 177,
180, 182, 184, 186, 189, 191, 193, 196, 198, 200, 203, 205, 208, 210, 213,
215, 218, 220, 223, 225, 228, 231, 233, 236, 239, 241, 244, 247, 249, 252,
255};

// Converts the array index to a memory location in the RGB buffers
static uint8_t get_safe_led_idex(uint8_t row, uint8_t column) {
const uint8_t rgb_led_index[WOOTING_RGB_ROWS][WOOTING_RGB_COLS] = {
@@ -214,9 +234,9 @@ static bool wooting_rgb_array_change_single(uint8_t row, uint8_t column, uint8_t
}

uint8_t buffer_index = pwm_mem_map[led_index % 24];
buffer_pointer[buffer_index] = red;
buffer_pointer[buffer_index + 0x10] = green;
buffer_pointer[buffer_index + 0x20] = blue;
buffer_pointer[buffer_index] = gammaFilter[red];
buffer_pointer[buffer_index + 0x10] = gammaFilter[green];
buffer_pointer[buffer_index + 0x20] = gammaFilter[blue];

if (led_index == LED_ENTER_ANSI) {
uint8_t iso_enter_index = pwm_mem_map[LED_ENTER_ISO - 48];

0 comments on commit c014b40

Please sign in to comment.