diff options
author | dbroqua <dbroqua@mousur.org> | 2017-04-29 15:04:01 +0200 |
---|---|---|
committer | dbroqua <dbroqua@mousur.org> | 2017-04-29 15:04:01 +0200 |
commit | 7180e195e84aabf252fcadb2852644417ac1d663 (patch) | |
tree | 2a314ac51bf1399c09a394e76ba81a56c072e7d6 /quantum | |
parent | 838aae164568a1092ae269267f8d8772d3aba781 (diff) | |
parent | 584b804ee33d53102fef3b8cdd045bca4c47bf26 (diff) |
Merge branch 'master' of https://github.com/Dbroqua/qmk_firmware
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/fauxclicky.c | 15 | ||||
-rw-r--r-- | quantum/fauxclicky.h | 10 | ||||
-rw-r--r-- | quantum/keymap_common.c | 7 | ||||
-rw-r--r-- | quantum/keymap_extras/keymap_german_ch.h | 4 | ||||
-rw-r--r-- | quantum/process_keycode/process_printer.c | 22 | ||||
-rw-r--r-- | quantum/process_keycode/process_printer.h | 2 | ||||
-rw-r--r-- | quantum/process_keycode/process_printer_bb.c | 4 | ||||
-rw-r--r-- | quantum/process_keycode/process_unicode.c | 1 | ||||
-rw-r--r-- | quantum/process_keycode/process_unicode_common.c | 1 | ||||
-rw-r--r-- | quantum/visualizer/lcd_keyframes.c | 4 |
10 files changed, 39 insertions, 31 deletions
diff --git a/quantum/fauxclicky.c b/quantum/fauxclicky.c index 13273e7058..c3341ca332 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/>. #include <stdbool.h> #include <musical_notes.h> -__attribute__ ((weak)) -float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, 2); -__attribute__ ((weak)) -float fauxclicky_released_note[2] = MUSICAL_NOTE(_A3, 2); -__attribute__ ((weak)) -float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, 2); - bool fauxclicky_enabled = true; uint16_t note_start = 0; bool note_playing = false; @@ -48,13 +41,13 @@ void fauxclicky_stop() note_playing = false; } -void fauxclicky_play(float note[2]) { +void fauxclicky_play(float note[]) { if (!fauxclicky_enabled) return; if (note_playing) fauxclicky_stop(); - FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)); - FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)) / 2); + FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER)); + FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * (float)FAUXCLICKY_CPU_PRESCALER)) / (float)2); note_playing = true; - note_period = (note[1] / 16) * (60 / (float)FAUXCLICKY_TEMPO) * 100; // check this + note_period = (note[1] / (float)16) * ((float)60 / (float)FAUXCLICKY_TEMPO) * 1000; note_start = timer_read(); FAUXCLICKY_ENABLE_OUTPUT; } diff --git a/quantum/fauxclicky.h b/quantum/fauxclicky.h index 109bd0d83e..1a8e188dd5 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/>. #include "stdbool.h" __attribute__ ((weak)) -float fauxclicky_pressed_note[2]; +float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25); __attribute__ ((weak)) -float fauxclicky_released_note[2]; +float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125); __attribute__ ((weak)) -float fauxclicky_beep_note[2]; +float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C4, 0.25); bool fauxclicky_enabled; @@ -73,11 +73,11 @@ bool fauxclicky_enabled; #endif #ifndef FAUXCLICKY_ENABLE_OUTPUT -#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1); +#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1) #endif #ifndef FAUXCLICKY_DISABLE_OUTPUT -#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0)); +#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0)) #endif #ifndef FAUXCLICKY_TIMER_PERIOD diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 6cf4f031ff..9dafc8b516 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) __attribute__ ((weak)) uint16_t keymap_function_id_to_action( uint16_t function_id ) { + // The compiler sees the empty (weak) fn_actions and generates a warning + // This function should not be called in that case, so the warning is too strict + // If this function is called however, the keymap should have overridden fn_actions, and then the compile + // is comparing against the wrong array + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Warray-bounds" return pgm_read_word(&fn_actions[function_id]); + #pragma GCC diagnostic pop } diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h index 8332e00af3..67350d6602 100644 --- a/quantum/keymap_extras/keymap_german_ch.h +++ b/quantum/keymap_extras/keymap_german_ch.h @@ -33,6 +33,10 @@ #define CH_E KC_E #define CH_F KC_F #define CH_G KC_G +#ifdef CH_H +// The ChibiOS ch.h file defines this... +#undef CH_H +#endif #define CH_H KC_H #define CH_I KC_I #define CH_J KC_J diff --git a/quantum/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c index 807f7a0b91..613af70183 100644 --- a/quantum/process_keycode/process_printer.c +++ b/quantum/process_keycode/process_printer.c @@ -20,12 +20,12 @@ bool printing_enabled = false; uint8_t character_shift = 0; -void enabled_printing() { +void enable_printing(void) { printing_enabled = true; serial_init(); } -void disable_printing() { +void disable_printing(void) { printing_enabled = false; } @@ -41,9 +41,14 @@ void print_char(char c) { USB_Init(); } -void print_box_string(uint8_t text[]) { - uint8_t len = strlen(text); - uint8_t out[len * 3 + 8]; +void print_string(char c[]) { + for(uint8_t i = 0; i < strlen(c); i++) + print_char(c[i]); +} + +void print_box_string(const char text[]) { + size_t len = strlen(text); + char out[len * 3 + 8]; out[0] = 0xDA; for (uint8_t i = 0; i < len; i++) { out[i+1] = 0xC4; @@ -69,14 +74,9 @@ void print_box_string(uint8_t text[]) { print_string(out); } -void print_string(char c[]) { - for(uint8_t i = 0; i < strlen(c); i++) - print_char(c[i]); -} - bool process_printer(uint16_t keycode, keyrecord_t *record) { if (keycode == PRINT_ON) { - enabled_printing(); + enable_printing(); return false; } if (keycode == PRINT_OFF) { diff --git a/quantum/process_keycode/process_printer.h b/quantum/process_keycode/process_printer.h index aa494ac8a7..71d3a4b56a 100644 --- a/quantum/process_keycode/process_printer.h +++ b/quantum/process_keycode/process_printer.h @@ -21,4 +21,6 @@ #include "protocol/serial.h" +bool process_printer(uint16_t keycode, keyrecord_t *record); + #endif diff --git a/quantum/process_keycode/process_printer_bb.c b/quantum/process_keycode/process_printer_bb.c index 55d3b552b2..3a00f169d8 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) { } -void enabled_printing() { +void enable_printing() { printing_enabled = true; serial_output(); serial_high(); @@ -82,7 +82,7 @@ void print_string(char c[]) { bool process_printer(uint16_t keycode, keyrecord_t *record) { if (keycode == PRINT_ON) { - enabled_printing(); + enable_printing(); return false; } if (keycode == PRINT_OFF) { diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 678a15234d..fd008eca12 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -15,6 +15,7 @@ */ #include "process_unicode.h" #include "action_util.h" +#include "eeprom.h" static uint8_t first_flag = 0; diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index 1dbdec3e71..84b5d673dd 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -15,6 +15,7 @@ */ #include "process_unicode_common.h" +#include "eeprom.h" static uint8_t input_mode; uint8_t mods; diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c index df11861ddc..82e4184d2c 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) { pos += 5; } if (state->status.leds & (1u << USB_LED_KANA)) { - memcpy(output + pos, "KANA ", 5); - pos += 5; + memcpy(output + pos, "KANA", 4); + pos += 4; } output[pos] = 0; } |