aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/fauxclicky.c15
-rw-r--r--quantum/fauxclicky.h10
-rw-r--r--quantum/keymap_common.c7
-rw-r--r--quantum/keymap_extras/keymap_german_ch.h4
-rw-r--r--quantum/process_keycode/process_printer.c22
-rw-r--r--quantum/process_keycode/process_printer.h2
-rw-r--r--quantum/process_keycode/process_printer_bb.c4
-rw-r--r--quantum/process_keycode/process_unicode.c1
-rw-r--r--quantum/process_keycode/process_unicode_common.c1
-rw-r--r--quantum/visualizer/lcd_keyframes.c4
10 files changed, 39 insertions, 31 deletions
diff --git a/quantum/fauxclicky.c b/quantum/fauxclicky.c
index 13273e705..c3341ca33 100644
--- a/quantum/fauxclicky.c
+++ b/quantum/fauxclicky.c
@@ -20,13 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include <stdbool.h> 20#include <stdbool.h>
21#include <musical_notes.h> 21#include <musical_notes.h>
22 22
23__attribute__ ((weak))
24float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, 2);
25__attribute__ ((weak))
26float fauxclicky_released_note[2] = MUSICAL_NOTE(_A3, 2);
27__attribute__ ((weak))
28float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, 2);
29
30bool fauxclicky_enabled = true; 23bool fauxclicky_enabled = true;
31uint16_t note_start = 0; 24uint16_t note_start = 0;
32bool note_playing = false; 25bool note_playing = false;
@@ -48,13 +41,13 @@ void fauxclicky_stop()
48 note_playing = false; 41 note_playing = false;
49} 42}
50 43
51void fauxclicky_play(float note[2]) { 44void fauxclicky_play(float note[]) {
52 if (!fauxclicky_enabled) return; 45 if (!fauxclicky_enabled) return;
53 if (note_playing) fauxclicky_stop(); 46 if (note_playing) fauxclicky_stop();
54 FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)); 47 FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER));
55 FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)) / 2); 48 FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER)) / (float)2);
56 note_playing = true; 49 note_playing = true;
57 note_period = (note[1] / 16) * (60 / (float)FAUXCLICKY_TEMPO) * 100; // check this 50 note_period = (note[1] / (float)16) * ((float)60 / (float)FAUXCLICKY_TEMPO) * 1000;
58 note_start = timer_read(); 51 note_start = timer_read();
59 FAUXCLICKY_ENABLE_OUTPUT; 52 FAUXCLICKY_ENABLE_OUTPUT;
60} 53}
diff --git a/quantum/fauxclicky.h b/quantum/fauxclicky.h
index 109bd0d83..1a8e188dd 100644
--- a/quantum/fauxclicky.h
+++ b/quantum/fauxclicky.h
@@ -21,11 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21#include "stdbool.h" 21#include "stdbool.h"
22 22
23__attribute__ ((weak)) 23__attribute__ ((weak))
24float fauxclicky_pressed_note[2]; 24float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
25__attribute__ ((weak)) 25__attribute__ ((weak))
26float fauxclicky_released_note[2]; 26float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
27__attribute__ ((weak)) 27__attribute__ ((weak))
28float fauxclicky_beep_note[2]; 28float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25);
29 29
30bool fauxclicky_enabled; 30bool fauxclicky_enabled;
31 31
@@ -73,11 +73,11 @@ bool fauxclicky_enabled;
73#endif 73#endif
74 74
75#ifndef FAUXCLICKY_ENABLE_OUTPUT 75#ifndef FAUXCLICKY_ENABLE_OUTPUT
76#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1); 76#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1)
77#endif 77#endif
78 78
79#ifndef FAUXCLICKY_DISABLE_OUTPUT 79#ifndef FAUXCLICKY_DISABLE_OUTPUT
80#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0)); 80#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0))
81#endif 81#endif
82 82
83#ifndef FAUXCLICKY_TIMER_PERIOD 83#ifndef FAUXCLICKY_TIMER_PERIOD
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 6cf4f031f..9dafc8b51 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -179,5 +179,12 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
179__attribute__ ((weak)) 179__attribute__ ((weak))
180uint16_t keymap_function_id_to_action( uint16_t function_id ) 180uint16_t keymap_function_id_to_action( uint16_t function_id )
181{ 181{
182 // The compiler sees the empty (weak) fn_actions and generates a warning
183 // This function should not be called in that case, so the warning is too strict
184 // If this function is called however, the keymap should have overridden fn_actions, and then the compile
185 // is comparing against the wrong array
186 #pragma GCC diagnostic push
187 #pragma GCC diagnostic ignored "-Warray-bounds"
182 return pgm_read_word(&fn_actions[function_id]); 188 return pgm_read_word(&fn_actions[function_id]);
189 #pragma GCC diagnostic pop
183} 190}
diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h
index 8332e00af..67350d660 100644
--- a/quantum/keymap_extras/keymap_german_ch.h
+++ b/quantum/keymap_extras/keymap_german_ch.h
@@ -33,6 +33,10 @@
33#define CH_E KC_E 33#define CH_E KC_E
34#define CH_F KC_F 34#define CH_F KC_F
35#define CH_G KC_G 35#define CH_G KC_G
36#ifdef CH_H
37// The ChibiOS ch.h file defines this...
38#undef CH_H
39#endif
36#define CH_H KC_H 40#define CH_H KC_H
37#define CH_I KC_I 41#define CH_I KC_I
38#define CH_J KC_J 42#define CH_J KC_J
diff --git a/quantum/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c
index 807f7a0b9..613af7018 100644
--- a/quantum/process_keycode/process_printer.c
+++ b/quantum/process_keycode/process_printer.c
@@ -20,12 +20,12 @@
20bool printing_enabled = false; 20bool printing_enabled = false;
21uint8_t character_shift = 0; 21uint8_t character_shift = 0;
22 22
23void enabled_printing() { 23void enable_printing(void) {
24 printing_enabled = true; 24 printing_enabled = true;
25 serial_init(); 25 serial_init();
26} 26}
27 27
28void disable_printing() { 28void disable_printing(void) {
29 printing_enabled = false; 29 printing_enabled = false;
30} 30}
31 31
@@ -41,9 +41,14 @@ void print_char(char c) {
41 USB_Init(); 41 USB_Init();
42} 42}
43 43
44void print_box_string(uint8_t text[]) { 44void print_string(char c[]) {
45 uint8_t len = strlen(text); 45 for(uint8_t i = 0; i < strlen(c); i++)
46 uint8_t out[len * 3 + 8]; 46 print_char(c[i]);
47}
48
49void print_box_string(const char text[]) {
50 size_t len = strlen(text);
51 char out[len * 3 + 8];
47 out[0] = 0xDA; 52 out[0] = 0xDA;
48 for (uint8_t i = 0; i < len; i++) { 53 for (uint8_t i = 0; i < len; i++) {
49 out[i+1] = 0xC4; 54 out[i+1] = 0xC4;
@@ -69,14 +74,9 @@ void print_box_string(uint8_t text[]) {
69 print_string(out); 74 print_string(out);
70} 75}
71 76
72void print_string(char c[]) {
73 for(uint8_t i = 0; i < strlen(c); i++)
74 print_char(c[i]);
75}
76
77bool process_printer(uint16_t keycode, keyrecord_t *record) { 77bool process_printer(uint16_t keycode, keyrecord_t *record) {
78 if (keycode == PRINT_ON) { 78 if (keycode == PRINT_ON) {
79 enabled_printing(); 79 enable_printing();
80 return false; 80 return false;
81 } 81 }
82 if (keycode == PRINT_OFF) { 82 if (keycode == PRINT_OFF) {
diff --git a/quantum/process_keycode/process_printer.h b/quantum/process_keycode/process_printer.h
index aa494ac8a..71d3a4b56 100644
--- a/quantum/process_keycode/process_printer.h
+++ b/quantum/process_keycode/process_printer.h
@@ -21,4 +21,6 @@
21 21
22#include "protocol/serial.h" 22#include "protocol/serial.h"
23 23
24bool process_printer(uint16_t keycode, keyrecord_t *record);
25
24#endif 26#endif
diff --git a/quantum/process_keycode/process_printer_bb.c b/quantum/process_keycode/process_printer_bb.c
index 55d3b552b..3a00f169d 100644
--- a/quantum/process_keycode/process_printer_bb.c
+++ b/quantum/process_keycode/process_printer_bb.c
@@ -46,7 +46,7 @@ void serial_output(void) {
46} 46}
47 47
48 48
49void enabled_printing() { 49void enable_printing() {
50 printing_enabled = true; 50 printing_enabled = true;
51 serial_output(); 51 serial_output();
52 serial_high(); 52 serial_high();
@@ -82,7 +82,7 @@ void print_string(char c[]) {
82 82
83bool process_printer(uint16_t keycode, keyrecord_t *record) { 83bool process_printer(uint16_t keycode, keyrecord_t *record) {
84 if (keycode == PRINT_ON) { 84 if (keycode == PRINT_ON) {
85 enabled_printing(); 85 enable_printing();
86 return false; 86 return false;
87 } 87 }
88 if (keycode == PRINT_OFF) { 88 if (keycode == PRINT_OFF) {
diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c
index 678a15234..fd008eca1 100644
--- a/quantum/process_keycode/process_unicode.c
+++ b/quantum/process_keycode/process_unicode.c
@@ -15,6 +15,7 @@
15 */ 15 */
16#include "process_unicode.h" 16#include "process_unicode.h"
17#include "action_util.h" 17#include "action_util.h"
18#include "eeprom.h"
18 19
19static uint8_t first_flag = 0; 20static uint8_t first_flag = 0;
20 21
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c
index 1dbdec3e7..84b5d673d 100644
--- a/quantum/process_keycode/process_unicode_common.c
+++ b/quantum/process_keycode/process_unicode_common.c
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include "process_unicode_common.h" 17#include "process_unicode_common.h"
18#include "eeprom.h"
18 19
19static uint8_t input_mode; 20static uint8_t input_mode;
20uint8_t mods; 21uint8_t mods;
diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c
index df11861dd..82e4184d2 100644
--- a/quantum/visualizer/lcd_keyframes.c
+++ b/quantum/visualizer/lcd_keyframes.c
@@ -125,8 +125,8 @@ static void get_led_state_string(char* output, visualizer_state_t* state) {
125 pos += 5; 125 pos += 5;
126 } 126 }
127 if (state->status.leds & (1u << USB_LED_KANA)) { 127 if (state->status.leds & (1u << USB_LED_KANA)) {
128 memcpy(output + pos, "KANA ", 5); 128 memcpy(output + pos, "KANA", 4);
129 pos += 5; 129 pos += 4;
130 } 130 }
131 output[pos] = 0; 131 output[pos] = 0;
132} 132}