~ruther/qmk_firmware

4b10235f6777db3e7a7feab301542a0e78083b20 — Konstantin Đorđević 5 years ago 6ef13f8
Set the correct RGB LED count on YD60MQ (#8629)

* Fix RGB LED count on YD60MQ

* Split YD60MQ into 12-LED and 16-LED revisions

* Update readmes

* Make 12led the default version

* Readd base rules.mk, version→variant in readme

* Add syntax highlighting to code blocks in readme
A keyboards/yd60mq/12led/config.h => keyboards/yd60mq/12led/config.h +5 -0
@@ 0,0 1,5 @@
#pragma once

#define DEVICE_VER 0x0001

#define RGBLED_NUM 12

A keyboards/yd60mq/12led/readme.md => keyboards/yd60mq/12led/readme.md +3 -0
@@ 0,0 1,3 @@
# YD60MQ – 12 LED

Code specific to the YD60MQ variant with 12 RGB LEDs on the back (unknown revision number).

A keyboards/yd60mq/12led/rules.mk => keyboards/yd60mq/12led/rules.mk +0 -0
A keyboards/yd60mq/16led/config.h => keyboards/yd60mq/16led/config.h +5 -0
@@ 0,0 1,5 @@
#pragma once

#define DEVICE_VER 0x0002

#define RGBLED_NUM 16

A keyboards/yd60mq/16led/readme.md => keyboards/yd60mq/16led/readme.md +3 -0
@@ 0,0 1,3 @@
# YD60MQ – 16 LED

Code specific to the YD60MQ variant with 16 RGB LEDs on the back (unknown revision number).

A keyboards/yd60mq/16led/rules.mk => keyboards/yd60mq/16led/rules.mk +0 -0
M keyboards/yd60mq/config.h => keyboards/yd60mq/config.h +1 -4
@@ 5,7 5,6 @@
/* USB Device descriptor parameter */
#define VENDOR_ID       0xFEED
#define PRODUCT_ID      0x6060
#define DEVICE_VER      0x0001
#define MANUFACTURER    YMDK
#define PRODUCT         YD60MQ
#define DESCRIPTION     Keyboard


@@ 37,10 36,8 @@
/* prevent stuck modifiers */

#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 12
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif
// RGBLED_NUM is defined in revisions

M keyboards/yd60mq/readme.md => keyboards/yd60mq/readme.md +13 -3
@@ 5,15 5,25 @@
Customizable 60% PCB by [YMDK](https://ymdk.aliexpress.com/store/429151?spm=2114.10010108.0.0.3ab23641lIkgzm).

* Keyboard Maintainer: QMK Community
* Hardware Supported: YD60MQ PCB, ATmega32U4
* Hardware Supported: YD60MQ PCB
    * 12led (unknown revision number, has 12 RGB LEDs on the back) – _default variant_
    * 16led (unknown revision number, has 16 RGB LEDs on the back)
* Hardware Availability: [YMDK on AliExpress](https://www.aliexpress.com/i/32869207240.html)

Make example for this keyboard (after setting up your build environment):

    make yd60mq:default
```sh
make yd60mq:default        # builds the 12 LED variant
make yd60mq/12led:default  # also builds the 12 LED variant
make yd60mq/16led:default  # builds the 16 LED variant
```

The keyboard uses a DFU bootloader. To make a keymap and use dfu to flash it:

    make yd60mq:default:flash
```sh
make yd60mq:default:flash        # builds and flashes the 12 LED variant
make yd60mq/12led:default:flash  # also builds and flashes the 12 LED variant
make yd60mq/16led:default:flash  # builds and flashes the 16 LED variant
```

See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

M keyboards/yd60mq/rules.mk => keyboards/yd60mq/rules.mk +2 -0
@@ 32,3 32,5 @@ FAUXCLICKY_ENABLE = no      # Use buzzer to emulate clicky switches
HD44780_ENABLE = no         # Enable support for HD44780 based LCDs

LAYOUTS = 60_ansi

DEFAULT_FOLDER = yd60mq/12led

M keyboards/yd60mq/yd60mq.c => keyboards/yd60mq/yd60mq.c +2 -0
@@ 1,10 1,12 @@
#include "yd60mq.h"

__attribute__((weak))
void matrix_init_kb(void){
    setPinOutput(F4);
    writePinHigh(F4);
}

__attribute__((weak))
bool led_update_kb(led_t led_state) {
    bool res = led_update_user(led_state);
    if (res) {