aboutsummaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2018-01-13 20:38:25 -0800
committerJack Humbert <jack.humb@gmail.com>2018-01-13 23:38:25 -0500
commit5836d1a06a7265781fa37acf13e3ba9df7224247 (patch)
treefe4161c2cb1dc28b5eab39c5d97caedc92b7efc8 /keyboards
parentfd359e23e8b46826f480d1bcf21261c3f777e2f4 (diff)
downloadqmk_firmware-5836d1a06a7265781fa37acf13e3ba9df7224247.tar.gz
qmk_firmware-5836d1a06a7265781fa37acf13e3ba9df7224247.zip
Fix up the ARM audio support (#2136)
* Get audio working on clueboard/60 * add keys for music mode * Change doubles to floats * add keys for all the songs * revert to the default startup sound * Remove music mode until we can figure out why it crashes
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/clueboard/60/keymaps/default/keymap.c94
-rw-r--r--keyboards/clueboard/60/led.c9
-rw-r--r--keyboards/clueboard/60/matrix.c6
-rw-r--r--keyboards/clueboard/60/rules.mk2
4 files changed, 94 insertions, 17 deletions
diff --git a/keyboards/clueboard/60/keymaps/default/keymap.c b/keyboards/clueboard/60/keymaps/default/keymap.c
index 1b0c71264..8397c4bbf 100644
--- a/keyboards/clueboard/60/keymaps/default/keymap.c
+++ b/keyboards/clueboard/60/keymaps/default/keymap.c
@@ -3,11 +3,35 @@
3#define _______ KC_TRNS 3#define _______ KC_TRNS
4 4
5enum keyboard_layers { 5enum keyboard_layers {
6 _BL, 6 _BL,
7 _FL, 7 _FL,
8 _CL 8 _CL
9}; 9};
10 10
11enum custom_keycodes {
12 S_BSKTC = SAFE_RANGE,
13 S_ODEJY,
14 S_RCKBY,
15 S_DOEDR,
16 S_SCALE,
17 S_ONEUP,
18 S_COIN,
19 S_SONIC,
20 S_ZELDA
21};
22
23#ifdef AUDIO_ENABLE
24 float song_basketcase[][2] = SONG(BASKET_CASE);
25 float song_ode_to_joy[][2] = SONG(ODE_TO_JOY);
26 float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY);
27 float song_doe_a_deer[][2] = SONG(DOE_A_DEER);
28 float song_scale[][2] = SONG(MUSIC_SCALE_SOUND);
29 float song_coin[][2] = SONG(COIN_SOUND);
30 float song_one_up[][2] = SONG(ONE_UP_SOUND);
31 float song_sonic_ring[][2] = SONG(SONIC_RING);
32 float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE);
33#endif
34
11const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 35const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
12 /* Layer 0: Default Layer 36 /* Layer 0: Default Layer
13 * ,-----------------------------------------------------------. 37 * ,-----------------------------------------------------------.
@@ -33,11 +57,71 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ 57 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
34 _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ 58 _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
35 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ 59 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \
36 _______, _______, _______, _______, _______, _______, MO(_FL), _______), 60 _______,_______,_______, _______, _______, _______, MO(_FL), _______),
37 [_CL] = KEYMAP( 61 [_CL] = KEYMAP(
38 BL_STEP,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\ 62 BL_STEP,S_BSKTC,S_ODEJY,S_RCKBY,S_DOEDR,S_SCALE,S_ONEUP,S_COIN, S_SONIC,S_ZELDA,_______,_______,_______,_______,_______,\
39 _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, \ 63 _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, \
40 _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ 64 _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
41 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ 65 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
42 _______, _______, _______, _______, _______, _______, MO(_FL), _______) 66 _______, _______, _______, _______, _______, _______, MO(_FL), _______)
43}; 67};
68
69bool process_record_user(uint16_t keycode, keyrecord_t *record) {
70 switch (keycode) {
71 case S_BSKTC:
72 if (record->event.pressed) {
73 stop_all_notes();
74 PLAY_SONG(song_basketcase);
75 }
76 return false;
77 case S_ODEJY:
78 if (record->event.pressed) {
79 stop_all_notes();
80 PLAY_SONG(song_ode_to_joy);
81 }
82 return false;
83 case S_RCKBY:
84 if (record->event.pressed) {
85 stop_all_notes();
86 PLAY_SONG(song_rock_a_bye_baby);
87 }
88 return false;
89 case S_DOEDR:
90 if (record->event.pressed) {
91 stop_all_notes();
92 PLAY_SONG(song_doe_a_deer);
93 }
94 return false;
95 case S_SCALE:
96 if (record->event.pressed) {
97 stop_all_notes();
98 PLAY_SONG(song_scale);
99 }
100 return false;
101 case S_ONEUP:
102 if (record->event.pressed) {
103 stop_all_notes();
104 PLAY_SONG(song_one_up);
105 }
106 return false;
107 case S_COIN:
108 if (record->event.pressed) {
109 stop_all_notes();
110 PLAY_SONG(song_coin);
111 }
112 return false;
113 case S_SONIC:
114 if (record->event.pressed) {
115 stop_all_notes();
116 PLAY_SONG(song_sonic_ring);
117 }
118 return false;
119 case S_ZELDA:
120 if (record->event.pressed) {
121 stop_all_notes();
122 PLAY_SONG(song_zelda_puzzle);
123 }
124 return false;
125 }
126 return true;
127}
diff --git a/keyboards/clueboard/60/led.c b/keyboards/clueboard/60/led.c
index fdf244ad5..350696736 100644
--- a/keyboards/clueboard/60/led.c
+++ b/keyboards/clueboard/60/led.c
@@ -23,7 +23,7 @@
23void backlight_init_ports(void) { 23void backlight_init_ports(void) {
24 printf("backlight_init_ports()\n"); 24 printf("backlight_init_ports()\n");
25 #ifdef BACKLIGHT_ENABLE 25 #ifdef BACKLIGHT_ENABLE
26 palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL); 26 palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL);
27 palSetPad(GPIOB, 8); 27 palSetPad(GPIOB, 8);
28 #endif 28 #endif
29} 29}
@@ -41,13 +41,8 @@ void backlight_set(uint8_t level) {
41 #endif 41 #endif
42} 42}
43 43
44void led_init_ports() {
45 printf("led_init_ports()\n");
46 palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL);
47}
48
49void led_set_kb(uint8_t usb_led) { 44void led_set_kb(uint8_t usb_led) {
50 printf("led_init_ports()\n"); 45 printf("led_set_kb(%d)\n", usb_led);
51 if (usb_led & (1<<USB_LED_CAPS_LOCK)) { 46 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
52 // Turn capslock on 47 // Turn capslock on
53 palSetPad(GPIOB, 7); 48 palSetPad(GPIOB, 7);
diff --git a/keyboards/clueboard/60/matrix.c b/keyboards/clueboard/60/matrix.c
index 4023bc03c..7c38a3bd4 100644
--- a/keyboards/clueboard/60/matrix.c
+++ b/keyboards/clueboard/60/matrix.c
@@ -71,10 +71,7 @@ void matrix_init(void) {
71 memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); 71 memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
72 memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); 72 memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t));
73 73
74 /* Setup capslock */ 74 palClearPad(GPIOB, 7); // Turn off capslock
75 // palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL);
76 // palClearPad(GPIOB, 7);
77
78 matrix_init_quantum(); 75 matrix_init_quantum();
79} 76}
80 77
@@ -138,6 +135,7 @@ uint8_t matrix_scan(void) {
138 debouncing_time = timer_read(); 135 debouncing_time = timer_read();
139 } 136 }
140 } 137 }
138
141 if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { 139 if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
142 for (int row = 0; row < MATRIX_ROWS; row++) { 140 for (int row = 0; row < MATRIX_ROWS; row++) {
143 matrix[row] = 0; 141 matrix[row] = 0;
diff --git a/keyboards/clueboard/60/rules.mk b/keyboards/clueboard/60/rules.mk
index 01b7dad9b..93e6019a4 100644
--- a/keyboards/clueboard/60/rules.mk
+++ b/keyboards/clueboard/60/rules.mk
@@ -50,5 +50,5 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
50#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 50#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
51NKRO_ENABLE = yes # USB Nkey Rollover 51NKRO_ENABLE = yes # USB Nkey Rollover
52CUSTOM_MATRIX = yes # Custom matrix file 52CUSTOM_MATRIX = yes # Custom matrix file
53#AUDIO_ENABLE = yes 53AUDIO_ENABLE = yes
54# SERIAL_LINK_ENABLE = yes 54# SERIAL_LINK_ENABLE = yes