Skip to content

Commit

Permalink
[Keyboard] Alps64 Refactor (#6723)
Browse files Browse the repository at this point in the history
* get rid of custom matrix that is no longer being used

* remove _kc LAYOUT

* remove ifdefs and replace with pragma once

* cleanup rules and use bootmagic lite

* get rid of led.c

* Update keyboards/alps64/alps64.c

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* remove unneeded configurations
  • Loading branch information
mechmerlin authored and drashna committed Sep 15, 2019
1 parent 6c87140 commit 9508b3f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 317 deletions.
29 changes: 18 additions & 11 deletions keyboards/alps64/alps64.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,24 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
#include "alps64.h"

#define LED_ON() do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0)
#define LED_OFF() do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0)
#define LED_TGL() do { DDRC |= (1<<5); PINC |= (1<<5); } while (0)
void keyboard_pre_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
setPinOutput(C5);
keyboard_pre_init_user();
}

void led_set_kb(uint8_t usb_led)
{
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
// output high
writePinHigh(C5);
} else {
// Hi-Z
writePinLow(C5);
}

void matrix_init_kb(void) {
LED_ON();
_delay_ms(500);
LED_OFF();

matrix_init_user();
}
led_set_user(usb_led);
}
22 changes: 1 addition & 21 deletions keyboards/alps64/alps64.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ALPS64_H
#define ALPS64_H
#pragma once

#include "quantum.h"

Expand Down Expand Up @@ -105,22 +104,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ KC_NO, K71, K72, K73, K74, K75, K76, K77 } \
}

#define LAYOUT_kc( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, K22, \
K30, K40, K50, K60, K70, K00, K10, K20 \
) { \
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \
{ KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
{ KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
{ KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
{ KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 } \
}

#endif
7 changes: 2 additions & 5 deletions keyboards/alps64/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H
#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6464
#define DEVICE_VER 0x0001
#define MANUFACTURER TMK
#define MANUFACTURER Hasu
#define PRODUCT Alps64
#define DESCRIPTION TMK keyboard firmware for Alps64

Expand Down Expand Up @@ -64,5 +63,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION

#endif
34 changes: 0 additions & 34 deletions keyboards/alps64/led.c

This file was deleted.

199 changes: 0 additions & 199 deletions keyboards/alps64/matrix.c

This file was deleted.

50 changes: 3 additions & 47 deletions keyboards/alps64/rules.mk
Original file line number Diff line number Diff line change
@@ -1,63 +1,19 @@


# Target file name (without extension).

# project specific files
SRC = led.c

# MCU name
MCU = atmega32u2

# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000


#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8

# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)

# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096

# OPT_DEFS += -DBOOTLOADER_SIZE=4096
BOOTLOADER = atmel-dfu

# Build Options
# change to no to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
Expand Down

0 comments on commit 9508b3f

Please sign in to comment.