Browse Source

Modularity and gcc warnings fixes.

tags/v2.9
flabbergast 8 years ago
parent
commit
be9be90483

+ 1
- 1
tmk_core/common.mk View File

COMMON_DIR = common
COMMON_DIR = $(TMK_DIR)/common
SRC += $(COMMON_DIR)/host.c \ SRC += $(COMMON_DIR)/host.c \
$(COMMON_DIR)/keyboard.c \ $(COMMON_DIR)/keyboard.c \
$(COMMON_DIR)/action.c \ $(COMMON_DIR)/action.c \

+ 1
- 1
tmk_core/common/action_tapping.c View File

return true; return true;
} }
} else { } 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); process_action(keyp);
return true; return true;
} }

+ 1
- 1
tmk_core/common/bootmagic.c View File

} }


/* do scans in case of bounce */ /* do scans in case of bounce */
print("boogmagic scan: ... ");
print("bootmagic scan: ... ");
uint8_t scan = 100; uint8_t scan = 100;
while (scan--) { matrix_scan(); _delay_ms(10); } while (scan--) { matrix_scan(); _delay_ms(10); }
print("done.\n"); print("done.\n");

+ 12
- 3
tmk_core/common/command.c View File

*/ */
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <util/delay.h>
#include "wait.h"
#include "keycode.h" #include "keycode.h"
#include "host.h" #include "host.h"
#include "keymap.h" #include "keymap.h"
bool command_extra(uint8_t code) __attribute__ ((weak)); bool command_extra(uint8_t code) __attribute__ ((weak));
bool command_extra(uint8_t code) bool command_extra(uint8_t code)
{ {
(void)code;
return false; return false;
} }


bool command_console_extra(uint8_t code) __attribute__ ((weak)); bool command_console_extra(uint8_t code) __attribute__ ((weak));
bool command_console_extra(uint8_t code) bool command_console_extra(uint8_t code)
{ {
(void)code;
return false; return false;
} }




static bool command_common(uint8_t code) static bool command_common(uint8_t code)
{ {
#ifdef KEYBOARD_LOCK_ENABLE
static host_driver_t *host_driver = 0; static host_driver_t *host_driver = 0;
#endif
switch (code) { switch (code) {
#ifdef SLEEP_LED_ENABLE #ifdef SLEEP_LED_ENABLE
case KC_Z: case KC_Z:
case KC_PAUSE: case KC_PAUSE:
clear_keyboard(); clear_keyboard();
print("\n\nbootloader... "); print("\n\nbootloader... ");
_delay_ms(1000);
wait_ms(1000);
bootloader_jump(); // not return bootloader_jump(); // not return
break; break;
case KC_D: case KC_D:
" " STR(BOOTLOADER_SIZE) "\n"); " " STR(BOOTLOADER_SIZE) "\n");


print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__)
#if defined(__AVR__)
" AVR-LIBC: " __AVR_LIBC_VERSION_STRING__ " AVR-LIBC: " __AVR_LIBC_VERSION_STRING__
" AVR_ARCH: avr" STR(__AVR_ARCH__) "\n"); " AVR_ARCH: avr" STR(__AVR_ARCH__) "\n");
#elif defined(__arm__)
// TODO
);
#endif
break; break;
case KC_S: case KC_S:
print("\n\t- Status -\n"); print("\n\t- Status -\n");
print_val_hex8(host_keyboard_leds()); print_val_hex8(host_keyboard_leds());
print_val_hex8(keyboard_protocol); print_val_hex8(keyboard_protocol);
print_val_hex8(keyboard_idle); print_val_hex8(keyboard_idle);
print_val_hex32(timer_count);
print_val_hex32(timer_read32());


#ifdef PROTOCOL_PJRC #ifdef PROTOCOL_PJRC
print_val_hex8(UDCON); print_val_hex8(UDCON);

+ 6
- 0
tmk_core/common/keymap.c View File

__attribute__ ((weak)) __attribute__ ((weak))
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
(void)record;
(void)id;
(void)opt;
return MACRO_NONE; return MACRO_NONE;
} }


__attribute__ ((weak)) __attribute__ ((weak))
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
(void)record;
(void)id;
(void)opt;
} }





+ 2
- 2
tmk_core/common/progmem.h View File

# include <avr/pgmspace.h> # include <avr/pgmspace.h>
#elif defined(__arm__) #elif defined(__arm__)
# define PROGMEM # 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


#endif #endif

Loading…
Cancel
Save