summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
authorWillyPillow <WillyPillow@users.noreply.github.com>2018-04-30 23:40:34 +0800
committerDrashna Jaelre <drashna@live.com>2018-04-30 08:40:34 -0700
commit9689944c16a5cda459801c9d77a34dc8a6be01b3 (patch)
tree9d39b6189a4ddb39feda3b4be8e10e661076fdb8 /keyboards
parentaade625054643a8b76d58b980fe09087db0fcebd (diff)
Clean up v60_type_r keyboard (#2848)
* Use *_kb instead of *_user in keyboard config * Place POLESTAR-only #includes in its #ifdef
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/v60_type_r/v60_type_r.c55
-rw-r--r--keyboards/v60_type_r/v60_type_r.h4
2 files changed, 11 insertions, 48 deletions
diff --git a/keyboards/v60_type_r/v60_type_r.c b/keyboards/v60_type_r/v60_type_r.c
index 016348db9f..86d87e12da 100644
--- a/keyboards/v60_type_r/v60_type_r.c
+++ b/keyboards/v60_type_r/v60_type_r.c
@@ -15,25 +15,28 @@
*/
#include "v60_type_r.h"
+#include "quantum.h"
+
+// if we've got an RGB underglow!
+#ifdef V60_POLESTAR
+
#include "rgblight.h"
#include <avr/pgmspace.h>
#include "action_layer.h"
-#include "quantum.h"
-// if we've got an RGB underglow!
-#ifdef V60_POLESTAR
#define SOFTPWM_LED_TIMER_TOP F_CPU/(256*64)
extern rgblight_config_t rgblight_config;
static uint8_t softpwm_buff[3] = {0};
-void matrix_init_user(void) {
+void matrix_init_kb(void) {
rgb_init();
+ matrix_init_user();
}
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
uint8_t r = led[0].r, g = led[0].g, b = led[0].b;
switch(keycode) {
case RGB_RI:
@@ -98,7 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
}
- return true;
+ return process_record_user(keycode, record);
}
@@ -188,44 +191,4 @@ ISR(TIMER1_COMPA_vect)
softpwm_buff[2] = led[0].b;
}
}
-#else
-
-void matrix_init_user(void) {
-}
-
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- return true;
-}
-
#endif // V60_POLESTAR
-
-// we need these functions for both versions
-void led_set_kb(uint8_t usb_led) {
- // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
-
- led_set_user(usb_led);
-}
-
-void matrix_scan_user(void) {
-}
-
-void matrix_init_kb(void) {
- // put your keyboard start-up code here
- // runs once when the firmware starts up
-
- matrix_init_user();
-}
-
-void matrix_scan_kb(void) {
- // put your looping keyboard code here
- // runs every cycle (a lot)
-
- matrix_scan_user();
-}
-
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
- // put your per-action keyboard code here
- // runs for every action, just before processing by the firmware
-
- return process_record_user(keycode, record);
-}
diff --git a/keyboards/v60_type_r/v60_type_r.h b/keyboards/v60_type_r/v60_type_r.h
index d65df2b3fd..3d7aef7eaf 100644
--- a/keyboards/v60_type_r/v60_type_r.h
+++ b/keyboards/v60_type_r/v60_type_r.h
@@ -18,10 +18,10 @@
#include "quantum.h"
-#include "rgblight.h"
-
#ifdef V60_POLESTAR
+#include "rgblight.h"
+
void rgb_init(void);
void set_rgb_color(uint8_t pin, uint8_t value, uint8_t timer_value);