Skip to content

Commit

Permalink
Terrazzo: Fix wrong LED Matrix function names (#12561)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Apr 13, 2021
1 parent ce99f98 commit a28fbcd
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/feature_led_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Custom layer effects can be done by defining this in your `<keyboard>.c`:

```c
void led_matrix_indicators_kb(void) {
led_matrix_set_index_value(index, value);
led_matrix_set_value(index, value);
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/feature_led_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ I2C IS31FL3731 RGB コントローラを使ったアドレス指定可能な LED
カスタムレイヤー効果は `<keyboard>.c` 内で以下を定義することで行うことができます:

void led_matrix_indicators_kb(void) {
led_matrix_set_index_value(index, value);
led_matrix_set_value(index, value);
}

同様の関数がキーマップ内で `led_matrix_indicators_user` として動作します。
Expand Down
4 changes: 2 additions & 2 deletions keyboards/terrazzo/terrazzo.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ uint8_t terrazzo_effect = 1;
void terrazzo_set_pixel(uint8_t x, uint8_t y, uint8_t value) {
uint8_t target = y * LED_MATRIX_COLS + x;
if (target < DRIVER_LED_TOTAL && target >= 0) {
led_matrix_set_index_value(y * LED_MATRIX_COLS + x, value);
led_matrix_set_value(y * LED_MATRIX_COLS + x, value);
}
}

Expand Down Expand Up @@ -112,7 +112,7 @@ void terrazzo_mode_off(void) {
void terrazzo_render(void) {
switch(terrazzo_effect) {
case TERRAZZO_NONE:
led_matrix_set_index_value_all(0);
led_matrix_set_value_all(0);
break;
#define TERRAZZO_EFFECT(name, ...) \
case TERRAZZO_EFFECT_##name: \
Expand Down
2 changes: 1 addition & 1 deletion keyboards/terrazzo/terrazzo_effects/dino.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static uint8_t dino_bg[10][42] = {
};

void DINO(uint8_t i, bool dir) {
led_matrix_set_index_value_all(0);
led_matrix_set_value_all(0);
if (dir) {
terrazzo_draw_at(0, 7, 7, 8, dino_frames[i % 2]);
} else {
Expand Down
4 changes: 2 additions & 2 deletions keyboards/terrazzo/terrazzo_effects/dot.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ TERRAZZO_EFFECT(DOT)
# ifdef TERRAZZO_EFFECT_IMPLS
// Animation for debugging. Lights one pixel according to animation index
void DOT(uint8_t i, bool dir) {
led_matrix_set_index_value_all(0);
led_matrix_set_index_value(i, 10);
led_matrix_set_value_all(0);
led_matrix_set_value(i, 10);
}

# endif
Expand Down
2 changes: 1 addition & 1 deletion keyboards/terrazzo/terrazzo_effects/heart.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static uint8_t heart_frames[4][105] = {


void HEART(uint8_t i, bool dir) {
led_matrix_set_index_value_all(0);
led_matrix_set_value_all(0);
terrazzo_draw_at(0, 0, 7, 15, heart_frames[i % 4]);
}

Expand Down
2 changes: 1 addition & 1 deletion keyboards/terrazzo/terrazzo_effects/outrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool last_dir;
uint8_t change_index = 0;

void OUTRUN(uint8_t i, bool dir) {
led_matrix_set_index_value_all(0);
led_matrix_set_value_all(0);

if(dir != last_dir) {
change_index = i;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/terrazzo/terrazzo_effects/pac_dude.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static uint8_t pac_ghost[20] = {


void PAC_DUDE(uint8_t i, bool dir) {
led_matrix_set_index_value_all(0);
led_matrix_set_value_all(0);
if (dir) {
terrazzo_draw_at(1, 4, 5, 5, pac_frames[i % 2]);
terrazzo_set_pixel(3, 0 + i % 3, 5);
Expand Down
4 changes: 2 additions & 2 deletions keyboards/terrazzo/terrazzo_effects/wpm_chart.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ static uint8_t number_3_4[10][12] = {
uint8_t wpm_levels[10] = {20, 9, 8, 7, 6, 5, 4, 3, 2, 1};

void WPM_CHART(uint8_t i, bool dir) {
led_matrix_set_index_value_all(0);
led_matrix_set_value_all(0);
uint8_t c_wpm = get_current_wpm();
uint8_t half_wpm = floor(c_wpm / 2);
uint8_t max_rows = 10;
/* Turn on LED for current WPM. Each pixel is 2 wpm. */
for (int k = 0; k < half_wpm && k < 70; k++) {
uint8_t current_row = (int)floor(k / 7);
led_matrix_set_index_value(k, wpm_levels[max_rows - current_row]);
led_matrix_set_value(k, wpm_levels[max_rows - current_row]);
};
uint8_t d1 = (int)floor(c_wpm / 10);
/* There is only room to print 2 digits. If the WPM is greater than
Expand Down

0 comments on commit a28fbcd

Please sign in to comment.