aboutsummaryrefslogtreecommitdiff
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
parentaade625054643a8b76d58b980fe09087db0fcebd (diff)
downloadqmk_firmware-9689944c16a5cda459801c9d77a34dc8a6be01b3.tar.gz
qmk_firmware-9689944c16a5cda459801c9d77a34dc8a6be01b3.zip
Clean up v60_type_r keyboard (#2848)
* Use *_kb instead of *_user in keyboard config * Place POLESTAR-only #includes in its #ifdef
-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 016348db9..86d87e12d 100644
--- a/keyboards/v60_type_r/v60_type_r.c
+++ b/keyboards/v60_type_r/v60_type_r.c
@@ -15,25 +15,28 @@
15 */ 15 */
16#include "v60_type_r.h" 16#include "v60_type_r.h"
17 17
18#include "quantum.h"
19
20// if we've got an RGB underglow!
21#ifdef V60_POLESTAR
22
18#include "rgblight.h" 23#include "rgblight.h"
19 24
20#include <avr/pgmspace.h> 25#include <avr/pgmspace.h>
21 26
22#include "action_layer.h" 27#include "action_layer.h"
23#include "quantum.h"
24 28
25// if we've got an RGB underglow!
26#ifdef V60_POLESTAR
27#define SOFTPWM_LED_TIMER_TOP F_CPU/(256*64) 29#define SOFTPWM_LED_TIMER_TOP F_CPU/(256*64)
28 30
29extern rgblight_config_t rgblight_config; 31extern rgblight_config_t rgblight_config;
30static uint8_t softpwm_buff[3] = {0}; 32static uint8_t softpwm_buff[3] = {0};
31 33
32void matrix_init_user(void) { 34void matrix_init_kb(void) {
33 rgb_init(); 35 rgb_init();
36 matrix_init_user();
34} 37}
35 38
36bool process_record_user(uint16_t keycode, keyrecord_t *record) { 39bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
37 uint8_t r = led[0].r, g = led[0].g, b = led[0].b; 40 uint8_t r = led[0].r, g = led[0].g, b = led[0].b;
38 switch(keycode) { 41 switch(keycode) {
39 case RGB_RI: 42 case RGB_RI:
@@ -98,7 +101,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
98 return false; 101 return false;
99 } 102 }
100 103
101 return true; 104 return process_record_user(keycode, record);
102} 105}
103 106
104 107
@@ -188,44 +191,4 @@ ISR(TIMER1_COMPA_vect)
188 softpwm_buff[2] = led[0].b; 191 softpwm_buff[2] = led[0].b;
189 } 192 }
190} 193}
191#else
192
193void matrix_init_user(void) {
194}
195
196bool process_record_user(uint16_t keycode, keyrecord_t *record) {
197 return true;
198}
199
200#endif // V60_POLESTAR 194#endif // V60_POLESTAR
201
202// we need these functions for both versions
203void led_set_kb(uint8_t usb_led) {
204 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
205
206 led_set_user(usb_led);
207}
208
209void matrix_scan_user(void) {
210}
211
212void matrix_init_kb(void) {
213 // put your keyboard start-up code here
214 // runs once when the firmware starts up
215
216 matrix_init_user();
217}
218
219void matrix_scan_kb(void) {
220 // put your looping keyboard code here
221 // runs every cycle (a lot)
222
223 matrix_scan_user();
224}
225
226bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
227 // put your per-action keyboard code here
228 // runs for every action, just before processing by the firmware
229
230 return process_record_user(keycode, record);
231}
diff --git a/keyboards/v60_type_r/v60_type_r.h b/keyboards/v60_type_r/v60_type_r.h
index d65df2b3f..3d7aef7ea 100644
--- a/keyboards/v60_type_r/v60_type_r.h
+++ b/keyboards/v60_type_r/v60_type_r.h
@@ -18,10 +18,10 @@
18 18
19#include "quantum.h" 19#include "quantum.h"
20 20
21#include "rgblight.h"
22
23#ifdef V60_POLESTAR 21#ifdef V60_POLESTAR
24 22
23#include "rgblight.h"
24
25void rgb_init(void); 25void rgb_init(void);
26void set_rgb_color(uint8_t pin, uint8_t value, uint8_t timer_value); 26void set_rgb_color(uint8_t pin, uint8_t value, uint8_t timer_value);
27 27