]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Modularity and gcc warnings fixes.
authorflabbergast <s3+flabbergast@sdfeu.org>
Mon, 7 Sep 2015 20:33:06 +0000 (21:33 +0100)
committerflabbergast <s3+flabbergast@sdfeu.org>
Mon, 7 Sep 2015 20:33:06 +0000 (21:33 +0100)
tmk_core/common.mk
tmk_core/common/action_tapping.c
tmk_core/common/bootmagic.c
tmk_core/common/command.c
tmk_core/common/keymap.c
tmk_core/common/progmem.h

index cb030b331333cd45cc965a4433819174faa92c01..f5a464d02dcb0a3febbea1eefd061e8b38a1af6b 100644 (file)
@@ -1,4 +1,4 @@
-COMMON_DIR = common
+COMMON_DIR = $(TMK_DIR)/common
 SRC += $(COMMON_DIR)/host.c \
        $(COMMON_DIR)/keyboard.c \
        $(COMMON_DIR)/action.c \
index 826c2330966a00050565b1358e6ee43f0baa0814..487c62f12e30a892c88514c689252511b7180a6e 100644 (file)
@@ -257,7 +257,7 @@ bool process_tapping(keyrecord_t *keyp)
                     return true;
                 }
             } else {
-                if (!IS_NOEVENT(event)) debug("Tapping: other key just after tap.\n");
+                if (!IS_NOEVENT(event)) debug("Tapping: other key just after tap.\n") {};
                 process_action(keyp);
                 return true;
             }
index b002a585622029f998a94adf8d95d2fa0ce7672b..d6684b2d57405c24c116a00f38538aecf28a8cbe 100644 (file)
@@ -19,7 +19,7 @@ void bootmagic(void)
     }
 
     /* do scans in case of bounce */
-    print("boogmagic scan: ... ");
+    print("bootmagic scan: ... ");
     uint8_t scan = 100;
     while (scan--) { matrix_scan(); _delay_ms(10); }
     print("done.\n");
index 1b6808be0ef15513f7f01df55117ddb1b7eedaf2..b017f2e2226722274e3c40c04670a7eed1a862db 100644 (file)
@@ -16,7 +16,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include <stdint.h>
 #include <stdbool.h>
-#include <util/delay.h>
+#include "wait.h"
 #include "keycode.h"
 #include "host.h"
 #include "keymap.h"
@@ -97,12 +97,14 @@ bool command_proc(uint8_t code)
 bool command_extra(uint8_t code) __attribute__ ((weak));
 bool command_extra(uint8_t code)
 {
+    (void)code;
     return false;
 }
 
 bool command_console_extra(uint8_t code) __attribute__ ((weak));
 bool command_console_extra(uint8_t code)
 {
+    (void)code;
     return false;
 }
 
@@ -178,7 +180,9 @@ static void print_eeconfig(void)
 
 static bool command_common(uint8_t code)
 {
+#ifdef KEYBOARD_LOCK_ENABLE
     static host_driver_t *host_driver = 0;
+#endif
     switch (code) {
 #ifdef SLEEP_LED_ENABLE
         case KC_Z:
@@ -223,7 +227,7 @@ static bool command_common(uint8_t code)
         case KC_PAUSE:
             clear_keyboard();
             print("\n\nbootloader... ");
-            _delay_ms(1000);
+            wait_ms(1000);
             bootloader_jump(); // not return
             break;
         case KC_D:
@@ -307,15 +311,20 @@ static bool command_common(uint8_t code)
             " " STR(BOOTLOADER_SIZE) "\n");
 
             print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__)
+#if defined(__AVR__)
                   " AVR-LIBC: " __AVR_LIBC_VERSION_STRING__
                   " AVR_ARCH: avr" STR(__AVR_ARCH__) "\n");
+#elif defined(__arm__)
+            // TODO
+            );
+#endif
             break;
         case KC_S:
             print("\n\t- Status -\n");
             print_val_hex8(host_keyboard_leds());
             print_val_hex8(keyboard_protocol);
             print_val_hex8(keyboard_idle);
-            print_val_hex32(timer_count);
+            print_val_hex32(timer_read32());
 
 #ifdef PROTOCOL_PJRC
             print_val_hex8(UDCON);
index 9f4fab521662ab84f4069e30a45b6eec2d9337cf..be00076caca024c2c8111bac59d27b9e81e57af9 100644 (file)
@@ -108,6 +108,9 @@ action_t action_for_key(uint8_t layer, keypos_t key)
 __attribute__ ((weak))
 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
 {
+    (void)record;
+    (void)id;
+    (void)opt;
     return MACRO_NONE;
 }
 
@@ -115,6 +118,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
 __attribute__ ((weak))
 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
 {
+    (void)record;
+    (void)id;
+    (void)opt;
 }
 
 
index 199b1bedfea9f7018903420ddca146da38482a60..5b276562505e55403ddd1687f685bdc5b2060b2b 100644 (file)
@@ -5,8 +5,8 @@
 #   include <avr/pgmspace.h>
 #elif defined(__arm__)
 #   define PROGMEM
-#   define pgm_read_byte(p)     *(p)
-#   define pgm_read_word(p)     *(p)
+#   define pgm_read_byte(p)     *((unsigned char*)p)
+#   define pgm_read_word(p)     *((uint16_t*)p)
 #endif
 
 #endif