diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
commit | 98b9909429aea0869f7a6f2f44ab386a4a3ff094 (patch) | |
tree | e1080a61bb89a75edc70818489f8044adf597c48 /keyboards/helix | |
parent | b610965fd6d851484025166fb255078b1c809261 (diff) | |
parent | fa3dd373b4925734d9843ae6014349069ffec353 (diff) | |
download | qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.tar.gz qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.zip |
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/helix')
103 files changed, 1606 insertions, 6518 deletions
diff --git a/keyboards/helix/local_drivers/i2c.c b/keyboards/helix/local_drivers/i2c.c deleted file mode 100644 index 9221429e96..0000000000 --- a/keyboards/helix/local_drivers/i2c.c +++ /dev/null @@ -1,159 +0,0 @@ -#include <util/twi.h> -#include <avr/io.h> -#include <stdlib.h> -#include <avr/interrupt.h> -#include <util/twi.h> -#include <stdbool.h> -#include "i2c.h" - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT) - lim++; - - // easier way, but will wait slightly longer - // _delay_us(100); -} - -// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK) -void i2c_master_init(void) { - // no prescaler - TWSR = 0; - // Set TWI clock frequency to SCL_CLOCK. Need TWBR>10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA); - - i2c_delay(); - - // check that we started successfully - if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START)) - return 1; - - TWDR = address; - TWCR = (1<<TWINT) | (1<<TWEN); - - i2c_delay(); - - if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) - return 1; // slave did not acknowledge - else - return 0; // success -} - - -// Finish the i2c transaction. -void i2c_master_stop(void) { - TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO); - - uint16_t lim = 0; - while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT) - lim++; -} - -// Write one byte to the i2c slave. -// returns 0 => slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<<TWINT) | (1<<TWEN); - - i2c_delay(); - - // check if the slave acknowledged us - return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1; -} - -// Read one byte from the i2c slave. If ack=1 the slave is acknowledged, -// if ack=0 the acknowledge bit is not set. -// returns: byte read from i2c device -uint8_t i2c_master_read(int ack) { - TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA); - - i2c_delay(); - return TWDR; -} - -void i2c_reset_state(void) { - TWCR = 0; -} - -void i2c_slave_init(uint8_t address) { - TWAR = address << 0; // slave i2c address - // TWEN - twi enable - // TWEA - enable address acknowledgement - // TWINT - twi interrupt flag - // TWIE - enable the twi interrupt - TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN); -} - -ISR(TWI_vect); - -ISR(TWI_vect) { - uint8_t ack = 1; - switch(TW_STATUS) { - case TW_SR_SLA_ACK: - // this device has been addressed as a slave receiver - slave_has_register_set = false; - break; - - case TW_SR_DATA_ACK: - // this device has received data as a slave receiver - // The first byte that we receive in this transaction sets the location - // of the read/write location of the slaves memory that it exposes over - // i2c. After that, bytes will be written at slave_buffer_pos, incrementing - // slave_buffer_pos after each write. - if(!slave_has_register_set) { - slave_buffer_pos = TWDR; - // don't acknowledge the master if this memory loctaion is out of bounds - if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN); -} diff --git a/keyboards/helix/local_drivers/i2c.h b/keyboards/helix/local_drivers/i2c.h deleted file mode 100644 index 47cf6bd1b2..0000000000 --- a/keyboards/helix/local_drivers/i2c.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef I2C_H -#define I2C_H - -#include <stdint.h> - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency 400kHz -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/helix/local_drivers/serial.c b/keyboards/helix/local_drivers/serial.c deleted file mode 100644 index 674c42d593..0000000000 --- a/keyboards/helix/local_drivers/serial.c +++ /dev/null @@ -1,589 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - * - * 2018-10-28 checked - * avr-gcc 4.9.2 - * avr-gcc 5.4.0 - * avr-gcc 7.3.0 - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include <avr/io.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include <stddef.h> -#include <stdbool.h> -#include "serial.h" - -#ifdef SOFT_SERIAL_PIN - -#ifdef __AVR_ATmega32U4__ - // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. - #ifdef USE_I2C - #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 - #error Using ATmega32U4 I2C, so can not use PD0, PD1 - #endif - #endif - - #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 - #define SERIAL_PIN_DDR DDRD - #define SERIAL_PIN_PORT PORTD - #define SERIAL_PIN_INPUT PIND - #if SOFT_SERIAL_PIN == D0 - #define SERIAL_PIN_MASK _BV(PD0) - #define EIMSK_BIT _BV(INT0) - #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) - #define SERIAL_PIN_INTERRUPT INT0_vect - #elif SOFT_SERIAL_PIN == D1 - #define SERIAL_PIN_MASK _BV(PD1) - #define EIMSK_BIT _BV(INT1) - #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) - #define SERIAL_PIN_INTERRUPT INT1_vect - #elif SOFT_SERIAL_PIN == D2 - #define SERIAL_PIN_MASK _BV(PD2) - #define EIMSK_BIT _BV(INT2) - #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) - #define SERIAL_PIN_INTERRUPT INT2_vect - #elif SOFT_SERIAL_PIN == D3 - #define SERIAL_PIN_MASK _BV(PD3) - #define EIMSK_BIT _BV(INT3) - #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) - #define SERIAL_PIN_INTERRUPT INT3_vect - #endif - #elif SOFT_SERIAL_PIN == E6 - #define SERIAL_PIN_DDR DDRE - #define SERIAL_PIN_PORT PORTE - #define SERIAL_PIN_INPUT PINE - #define SERIAL_PIN_MASK _BV(PE6) - #define EIMSK_BIT _BV(INT6) - #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) - #define SERIAL_PIN_INTERRUPT INT6_vect - #else - #error invalid SOFT_SERIAL_PIN value - #endif - -#else - #error serial.c now support ATmega32U4 only -#endif - -//////////////// for backward compatibility //////////////////////////////// -#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) -/* --- USE OLD API (compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; - #endif - #if SERIAL_MASTER_BUFFER_LENGTH > 0 - uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - #endif - uint8_t volatile status0 = 0; - -SSTD_t transactions[] = { - { (uint8_t *)&status0, - #if SERIAL_MASTER_BUFFER_LENGTH > 0 - sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, - #else - 0, (uint8_t *)NULL, - #endif - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer - #else - 0, (uint8_t *)NULL, - #endif - } -}; - -void serial_master_init(void) -{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } - -void serial_slave_init(void) -{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } - -// 0 => no error -// 1 => slave did not respond -// 2 => checksum error -int serial_update_buffers() -{ - int result; - result = soft_serial_transaction(); - return result; -} - -#endif // end of OLD API (compatible with let's split serial.c) -//////////////////////////////////////////////////////////////////////////// - -#define ALWAYS_INLINE __attribute__((always_inline)) -#define NO_INLINE __attribute__((noinline)) -#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) - -// parity check -#define ODD_PARITY 1 -#define EVEN_PARITY 0 -#define PARITY EVEN_PARITY - -#ifdef SERIAL_DELAY - // custom setup in config.h - // #define TID_SEND_ADJUST 2 - // #define SERIAL_DELAY 6 // micro sec - // #define READ_WRITE_START_ADJUST 30 // cycles - // #define READ_WRITE_WIDTH_ADJUST 8 // cycles -#else -// ============ Standard setups ============ - -#ifndef SELECT_SOFT_SERIAL_SPEED -#define SELECT_SOFT_SERIAL_SPEED 1 -// 0: about 189kbps -// 1: about 137kbps (default) -// 2: about 75kbps -// 3: about 39kbps -// 4: about 26kbps -// 5: about 20kbps -#endif - -#if __GNUC__ < 6 - #define TID_SEND_ADJUST 14 -#else - #define TID_SEND_ADJUST 2 -#endif - -#if SELECT_SOFT_SERIAL_SPEED == 0 - // Very High speed - #define SERIAL_DELAY 4 // micro sec - #if __GNUC__ < 6 - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_START_ADJUST 34 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 1 - // High speed - #define SERIAL_DELAY 6 // micro sec - #if __GNUC__ < 6 - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 2 - // Middle speed - #define SERIAL_DELAY 12 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 3 - // Low speed - #define SERIAL_DELAY 24 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 4 - // Very Low speed - #define SERIAL_DELAY 36 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#elif SELECT_SOFT_SERIAL_SPEED == 5 - // Ultra Low speed - #define SERIAL_DELAY 48 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #if __GNUC__ < 6 - #define READ_WRITE_WIDTH_ADJUST 3 // cycles - #else - #define READ_WRITE_WIDTH_ADJUST 7 // cycles - #endif -#else -#error invalid SELECT_SOFT_SERIAL_SPEED value -#endif /* SELECT_SOFT_SERIAL_SPEED */ -#endif /* SERIAL_DELAY */ - -#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) -#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) - -#define SLAVE_INT_WIDTH_US 1 -#ifndef SERIAL_USE_MULTI_TRANSACTION - #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY -#else - #define SLAVE_INT_ACK_WIDTH_UNIT 2 - #define SLAVE_INT_ACK_WIDTH 4 -#endif - -static SSTD_t *Transaction_table = NULL; -static uint8_t Transaction_table_size = 0; - -inline static void serial_delay(void) ALWAYS_INLINE; -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static void serial_delay_half1(void) ALWAYS_INLINE; -inline static -void serial_delay_half1(void) { - _delay_us(SERIAL_DELAY_HALF1); -} - -inline static void serial_delay_half2(void) ALWAYS_INLINE; -inline static -void serial_delay_half2(void) { - _delay_us(SERIAL_DELAY_HALF2); -} - -inline static void serial_output(void) ALWAYS_INLINE; -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static void serial_input_with_pullup(void) ALWAYS_INLINE; -inline static -void serial_input_with_pullup(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static void serial_low(void) ALWAYS_INLINE; -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static void serial_high(void) ALWAYS_INLINE; -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) -{ - Transaction_table = sstd_table; - Transaction_table_size = (uint8_t)sstd_table_size; - serial_output(); - serial_high(); -} - -void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) -{ - Transaction_table = sstd_table; - Transaction_table_size = (uint8_t)sstd_table_size; - serial_input_with_pullup(); - - // Enable INT0-INT3,INT6 - EIMSK |= EIMSK_BIT; -#if SERIAL_PIN_MASK == _BV(PE6) - // Trigger on falling edge of INT6 - EICRB &= EICRx_BIT; -#else - // Trigger on falling edge of INT0-INT3 - EICRA &= EICRx_BIT; -#endif -} - -// Used by the sender to synchronize timing with the reciver. -static void sync_recv(void) NO_INLINE; -static -void sync_recv(void) { - for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { - } - // This shouldn't hang if the target disconnects because the - // serial line will float to high if the target does disconnect. - while (!serial_read_pin()); -} - -// Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void) NO_INLINE; -static -void sync_send(void) { - serial_low(); - serial_delay(); - serial_high(); -} - -// Reads a byte from the serial line -static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; -static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { - uint8_t byte, i, p, pb; - - _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { - serial_delay_half1(); // read the middle of pulses - if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; - } else { - byte = (byte << 1) | 0; p ^= 0; - } - _delay_sub_us(READ_WRITE_WIDTH_ADJUST); - serial_delay_half2(); - } - /* recive parity bit */ - serial_delay_half1(); // read the middle of pulses - pb = serial_read_pin(); - _delay_sub_us(READ_WRITE_WIDTH_ADJUST); - serial_delay_half2(); - - *pterrcount += (p != pb)? 1 : 0; - - return byte; -} - -// Sends a byte with MSB ordering -void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; -void serial_write_chunk(uint8_t data, uint8_t bit) { - uint8_t b, p; - for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); - } - /* send parity bit */ - if(p & 1) { serial_high(); } - else { serial_low(); } - serial_delay(); - - serial_low(); // sync_send() / senc_recv() need raise edge -} - -static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; -static -void serial_send_packet(uint8_t *buffer, uint8_t size) { - for (uint8_t i = 0; i < size; ++i) { - uint8_t data; - data = buffer[i]; - sync_send(); - serial_write_chunk(data,8); - } -} - -static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; -static -uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { - uint8_t pecount = 0; - for (uint8_t i = 0; i < size; ++i) { - uint8_t data; - sync_recv(); - data = serial_read_chunk(&pecount, 8); - buffer[i] = data; - } - return pecount == 0; -} - -inline static -void change_sender2reciver(void) { - sync_send(); //0 - serial_delay_half1(); //1 - serial_low(); //2 - serial_input_with_pullup(); //2 - serial_delay_half1(); //3 -} - -inline static -void change_reciver2sender(void) { - sync_recv(); //0 - serial_delay(); //1 - serial_low(); //3 - serial_output(); //3 - serial_delay_half1(); //4 -} - -static inline uint8_t nibble_bits_count(uint8_t bits) -{ - bits = (bits & 0x5) + (bits >> 1 & 0x5); - bits = (bits & 0x3) + (bits >> 2 & 0x3); - return bits; -} - -// interrupt handle to be used by the target device -ISR(SERIAL_PIN_INTERRUPT) { - -#ifndef SERIAL_USE_MULTI_TRANSACTION - serial_low(); - serial_output(); - SSTD_t *trans = Transaction_table; -#else - // recive transaction table index - uint8_t tid, bits; - uint8_t pecount = 0; - sync_recv(); - bits = serial_read_chunk(&pecount,7); - tid = bits>>3; - bits = (bits&7) != nibble_bits_count(tid); - if( bits || pecount> 0 || tid > Transaction_table_size ) { - return; - } - serial_delay_half1(); - - serial_high(); // response step1 low->high - serial_output(); - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); - SSTD_t *trans = &Transaction_table[tid]; - serial_low(); // response step2 ack high->low -#endif - - // target send phase - if( trans->target2initiator_buffer_size > 0 ) - serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); - // target switch to input - change_sender2reciver(); - - // target recive phase - if( trans->initiator2target_buffer_size > 0 ) { - if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; - } else { - *trans->status = TRANSACTION_DATA_ERROR; - } - } else { - *trans->status = TRANSACTION_ACCEPTED; - } - - sync_recv(); //weit initiator output to high -} - -///////// -// start transaction by initiator -// -// int soft_serial_transaction(int sstd_index) -// -// Returns: -// TRANSACTION_END -// TRANSACTION_NO_RESPONSE -// TRANSACTION_DATA_ERROR -// this code is very time dependent, so we need to disable interrupts -#ifndef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_transaction(void) { - SSTD_t *trans = Transaction_table; -#else -int soft_serial_transaction(int sstd_index) { - if( sstd_index > Transaction_table_size ) - return TRANSACTION_TYPE_ERROR; - SSTD_t *trans = &Transaction_table[sstd_index]; -#endif - cli(); - - // signal to the target that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(SLAVE_INT_WIDTH_US); - -#ifndef SERIAL_USE_MULTI_TRANSACTION - // wait for the target response - serial_input_with_pullup(); - _delay_us(SLAVE_INT_RESPONSE_TIME); - - // check if the target is present - if (serial_read_pin()) { - // target failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; - } - -#else - // send transaction table index - int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); - sync_send(); - _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(tid, 7); - serial_delay_half1(); - - // wait for the target response (step1 low->high) - serial_input_with_pullup(); - while( !serial_read_pin() ) { - _delay_sub_us(2); - } - - // check if the target is present (step2 high->low) - for( int i = 0; serial_read_pin(); i++ ) { - if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; - } - _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); - } -#endif - - // initiator recive phase - // if the target is present syncronize with it - if( trans->target2initiator_buffer_size > 0 ) { - if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; - } - } - - // initiator switch to output - change_reciver2sender(); - - // initiator send phase - if( trans->initiator2target_buffer_size > 0 ) { - serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); - } - - // always, release the line when not in use - sync_send(); - - *trans->status = TRANSACTION_END; - sei(); - return TRANSACTION_END; -} - -#ifdef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_get_and_clean_status(int sstd_index) { - SSTD_t *trans = &Transaction_table[sstd_index]; - cli(); - int retval = *trans->status; - *trans->status = 0;; - sei(); - return retval; -} -#endif - -#endif - -// Helix serial.c history -// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) -// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) -// (adjusted with avr-gcc 4.9.2) -// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) -// (adjusted with avr-gcc 4.9.2) -// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) -// (adjusted with avr-gcc 4.9.2) -// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) -// (adjusted with avr-gcc 7.3.0) -// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) -// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/helix/local_drivers/serial.h b/keyboards/helix/local_drivers/serial.h deleted file mode 100644 index 2e53928df2..0000000000 --- a/keyboards/helix/local_drivers/serial.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef SOFT_SERIAL_H -#define SOFT_SERIAL_H - -#include <stdbool.h> - -// ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in config.h -// ///////////////////////////////////////////////////////////////// -// ex. -// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 -// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 -// // 1: about 137kbps (default) -// // 2: about 75kbps -// // 3: about 39kbps -// // 4: about 26kbps -// // 5: about 20kbps -// -// //// USE OLD API (compatible with let's split serial.c) -// ex. -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -// #define SERIAL_MASTER_BUFFER_LENGTH 1 -// -// //// USE NEW API -// //// USE simple API (using signle-type transaction function) -// #define SERIAL_USE_SINGLE_TRANSACTION -// //// USE flexible API (using multi-type transaction function) -// #define SERIAL_USE_MULTI_TRANSACTION -// -// ///////////////////////////////////////////////////////////////// - - -//////////////// for backward compatibility //////////////////////////////// -#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) -/* --- USE OLD API (compatible with let's split serial.c) */ - #if SERIAL_SLAVE_BUFFER_LENGTH > 0 - extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; - #endif - #if SERIAL_MASTER_BUFFER_LENGTH > 0 - extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - #endif - - void serial_master_init(void); - void serial_slave_init(void); - int serial_update_buffers(void); - -#endif // end of USE OLD API -//////////////////////////////////////////////////////////////////////////// - -// Soft Serial Transaction Descriptor -typedef struct _SSTD_t { - uint8_t *status; - uint8_t initiator2target_buffer_size; - uint8_t *initiator2target_buffer; - uint8_t target2initiator_buffer_size; - uint8_t *target2initiator_buffer; -} SSTD_t; -#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) - -// initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); -// target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); - -// initiator resullt -#define TRANSACTION_END 0 -#define TRANSACTION_NO_RESPONSE 0x1 -#define TRANSACTION_DATA_ERROR 0x2 -#define TRANSACTION_TYPE_ERROR 0x4 -#ifndef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_transaction(void); -#else -int soft_serial_transaction(int sstd_index); -#endif - -// target status -// *SSTD_t.status has -// initiator: -// TRANSACTION_END -// or TRANSACTION_NO_RESPONSE -// or TRANSACTION_DATA_ERROR -// target: -// TRANSACTION_DATA_ERROR -// or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x8 -#ifdef SERIAL_USE_MULTI_TRANSACTION -int soft_serial_get_and_clean_status(int sstd_index); -#endif - -#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/helix/local_drivers/ssd1306.c b/keyboards/helix/local_drivers/ssd1306.c deleted file mode 100644 index 1cfb38037c..0000000000 --- a/keyboards/helix/local_drivers/ssd1306.c +++ /dev/null @@ -1,341 +0,0 @@ - -#ifdef SSD1306OLED - -#include "ssd1306.h" -#include "i2c.h" -#include <string.h> -#include "print.h" -#ifndef LOCAL_GLCDFONT -#include "common/glcdfont.c" -#else -#include "helixfont.h" -#endif -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#endif -#include "sendchar.h" -#include "timer.h" - -struct CharacterMatrix display; - -// Set this to 1 to help diagnose early startup problems -// when testing power-on with ble. Turn it off otherwise, -// as the latency of printing most of the debug info messes -// with the matrix scan, causing keys to drop. -#define DEBUG_TO_SCREEN 0 - -//static uint16_t last_battery_update; -//static uint32_t vbat; -//#define BatteryUpdateInterval 10000 /* milliseconds */ - -// 'last_flush' is declared as uint16_t, -// so this must be less than 65535 -#define ScreenOffInterval 60000 /* milliseconds */ -#if DEBUG_TO_SCREEN -static uint8_t displaying; -#endif -static uint16_t last_flush; - -static bool force_dirty = true; - -// Write command sequence. -// Returns true on success. -static inline bool _send_cmd1(uint8_t cmd) { - bool res = false; - - if (i2c_start_write(SSD1306_ADDRESS)) { - xprintf("failed to start write to %d\n", SSD1306_ADDRESS); - goto done; - } - - if (i2c_master_write(0x0 /* command byte follows */)) { - print("failed to write control byte\n"); - - goto done; - } - - if (i2c_master_write(cmd)) { - xprintf("failed to write command %d\n", cmd); - goto done; - } - res = true; -done: - i2c_master_stop(); - return res; -} - -// Write 2-byte command sequence. -// Returns true on success -static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { - if (!_send_cmd1(cmd)) { - return false; - } - return _send_cmd1(opr); -} - -// Write 3-byte command sequence. -// Returns true on success -static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { - if (!_send_cmd1(cmd)) { - return false; - } - if (!_send_cmd1(opr1)) { - return false; - } - return _send_cmd1(opr2); -} - -#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} -#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} -#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} - -static void clear_display(void) { - matrix_clear(&display); - - // Clear all of the display bits (there can be random noise - // in the RAM on startup) - send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); - send_cmd3(ColumnAddr, 0, DisplayWidth - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < DisplayWidth; ++col) { - i2c_master_write(0); - } - } - - display.dirty = false; - -done: - i2c_master_stop(); -} - -#if DEBUG_TO_SCREEN -#undef sendchar -static int8_t capture_sendchar(uint8_t c) { - sendchar(c); - iota_gfx_write_char(c); - - if (!displaying) { - iota_gfx_flush(); - } - return 0; -} -#endif - -bool iota_gfx_init(bool rotate) { - bool success = false; - - i2c_master_init(); - send_cmd1(DisplayOff); - send_cmd2(SetDisplayClockDiv, 0x80); - send_cmd2(SetMultiPlex, DisplayHeight - 1); - - send_cmd2(SetDisplayOffset, 0); - - - send_cmd1(SetStartLine | 0x0); - send_cmd2(SetChargePump, 0x14 /* Enable */); - send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); - - if(rotate){ - // the following Flip the display orientation 180 degrees - send_cmd1(SegRemap); - send_cmd1(ComScanInc); - }else{ - // Flips the display orientation 0 degrees - send_cmd1(SegRemap | 0x1); - send_cmd1(ComScanDec); - } - - send_cmd2(SetComPins, 0x2); - send_cmd2(SetContrast, 0x8f); - send_cmd2(SetPreCharge, 0xf1); - send_cmd2(SetVComDetect, 0x40); - send_cmd1(DisplayAllOnResume); - send_cmd1(NormalDisplay); - send_cmd1(DeActivateScroll); - send_cmd1(DisplayOn); - - send_cmd2(SetContrast, 0); // Dim - - clear_display(); - - success = true; - - iota_gfx_flush(); - -#if DEBUG_TO_SCREEN - print_set_sendchar(capture_sendchar); -#endif - -done: - return success; -} - -bool iota_gfx_off(void) { - bool success = false; - - send_cmd1(DisplayOff); - success = true; - -done: - return success; -} - -bool iota_gfx_on(void) { - bool success = false; - - send_cmd1(DisplayOn); - success = true; - -done: - return success; -} - -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { - *matrix->cursor = c; - ++matrix->cursor; - - if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { - // We went off the end; scroll the display upwards by one line - memmove(&matrix->display[0], &matrix->display[1], - MatrixCols * (MatrixRows - 1)); - matrix->cursor = &matrix->display[MatrixRows - 1][0]; - memset(matrix->cursor, ' ', MatrixCols); - } -} - -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { - matrix->dirty = true; - - if (c == '\n') { - // Clear to end of line from the cursor and then move to the - // start of the next line - uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; - - while (cursor_col++ < MatrixCols) { - matrix_write_char_inner(matrix, ' '); - } - return; - } - - matrix_write_char_inner(matrix, c); -} - -void iota_gfx_write_char(uint8_t c) { - matrix_write_char(&display, c); -} - -void matrix_write(struct CharacterMatrix *matrix, const char *data) { - const char *end = data + strlen(data); - while (data < end) { - matrix_write_char(matrix, *data); - ++data; - } -} - -void iota_gfx_write(const char *data) { - matrix_write(&display, data); -} - -void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { - while (true) { - uint8_t c = pgm_read_byte(data); - if (c == 0) { - return; - } - matrix_write_char(matrix, c); - ++data; - } -} - -void iota_gfx_write_P(const char *data) { - matrix_write_P(&display, data); -} - -void matrix_clear(struct CharacterMatrix *matrix) { - memset(matrix->display, ' ', sizeof(matrix->display)); - matrix->cursor = &matrix->display[0][0]; - matrix->dirty = true; -} - -void iota_gfx_clear_screen(void) { - matrix_clear(&display); -} - -void matrix_render(struct CharacterMatrix *matrix) { - last_flush = timer_read(); - iota_gfx_on(); -#if DEBUG_TO_SCREEN - ++displaying; -#endif - - // Move to the home position - send_cmd3(PageAddr, 0, MatrixRows - 1); - send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < MatrixCols; ++col) { - const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); - - for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { - uint8_t colBits = pgm_read_byte(glyph + glyphCol); - i2c_master_write(colBits); - } - - // 1 column of space between chars (it's not included in the glyph) - //i2c_master_write(0); - } - } - - matrix->dirty = false; - -done: - i2c_master_stop(); -#if DEBUG_TO_SCREEN - --displaying; -#endif -} - -void iota_gfx_flush(void) { - matrix_render(&display); -} - -__attribute__ ((weak)) -void iota_gfx_task_user(void) { -} - -void iota_gfx_task(void) { - iota_gfx_task_user(); - - if (display.dirty|| force_dirty) { - iota_gfx_flush(); - force_dirty = false; - } - - if (timer_elapsed(last_flush) > ScreenOffInterval) { - iota_gfx_off(); - } -} - -bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { - force_dirty = true; - return true; -} - -#endif diff --git a/keyboards/helix/local_drivers/ssd1306.h b/keyboards/helix/local_drivers/ssd1306.h deleted file mode 100644 index bcb30f8859..0000000000 --- a/keyboards/helix/local_drivers/ssd1306.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef SSD1306_H -#define SSD1306_H - -#include <stdbool.h> -#include <stdio.h> -#include "action.h" - -enum ssd1306_cmds { - DisplayOff = 0xAE, - DisplayOn = 0xAF, - - SetContrast = 0x81, - DisplayAllOnResume = 0xA4, - - DisplayAllOn = 0xA5, - NormalDisplay = 0xA6, - InvertDisplay = 0xA7, - SetDisplayOffset = 0xD3, - SetComPins = 0xda, - SetVComDetect = 0xdb, - SetDisplayClockDiv = 0xD5, - SetPreCharge = 0xd9, - SetMultiPlex = 0xa8, - SetLowColumn = 0x00, - SetHighColumn = 0x10, - SetStartLine = 0x40, - - SetMemoryMode = 0x20, - ColumnAddr = 0x21, - PageAddr = 0x22, - - ComScanInc = 0xc0, - ComScanDec = 0xc8, - SegRemap = 0xa0, - SetChargePump = 0x8d, - ExternalVcc = 0x01, - SwitchCapVcc = 0x02, - - ActivateScroll = 0x2f, - DeActivateScroll = 0x2e, - SetVerticalScrollArea = 0xa3, - RightHorizontalScroll = 0x26, - LeftHorizontalScroll = 0x27, - VerticalAndRightHorizontalScroll = 0x29, - VerticalAndLeftHorizontalScroll = 0x2a, -}; - -// Controls the SSD1306 128x32 OLED display via i2c - -#ifndef SSD1306_ADDRESS -#define SSD1306_ADDRESS 0x3C -#endif - -#define DisplayHeight 32 -#define DisplayWidth 128 - -#define FontHeight 8 -#define FontWidth 6 - -#define MatrixRows (DisplayHeight / FontHeight) -#define MatrixCols (DisplayWidth / FontWidth) - -struct CharacterMatrix { - uint8_t display[MatrixRows][MatrixCols]; - uint8_t *cursor; - bool dirty; -}; - -extern struct CharacterMatrix display; - -bool iota_gfx_init(bool rotate); -void iota_gfx_task(void); -bool iota_gfx_off(void); -bool iota_gfx_on(void); -void iota_gfx_flush(void); -void iota_gfx_write_char(uint8_t c); -void iota_gfx_write(const char *data); -void iota_gfx_write_P(const char *data); -void iota_gfx_clear_screen(void); - -void iota_gfx_task_user(void); - -void matrix_clear(struct CharacterMatrix *matrix); -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write(struct CharacterMatrix *matrix, const char *data); -void matrix_write_P(struct CharacterMatrix *matrix, const char *data); -void matrix_render(struct CharacterMatrix *matrix); - -bool process_record_gfx(uint16_t keycode, keyrecord_t *record); - -#endif diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h index b01fd3a001..b08865d0a4 100644 --- a/keyboards/helix/pico/config.h +++ b/keyboards/helix/pico/config.h @@ -1,6 +1,7 @@ /* Copyright 2012 Jun Wako <wakojun@gmail.com> Copyright 2015 Jack Humbert +Copyright 2018 MakotoKurauchi This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,12 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // #define MASTER_RIGHT // #define EE_HANDS -// Helix keyboard OLED support -// see ./rules.mk: OLED_ENABLE=yes or no -#ifdef OLED_ENABLE - #define SSD1306OLED -#endif - /* key matrix size */ // Rows are doubled-up #define MATRIX_ROWS 8 @@ -114,8 +109,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) // USB_MAX_POWER_CONSUMPTION value for Helix keyboard -// 120 RGBoff, OLEDoff -// 120 OLED +// 120 RGBoff // 330 RGB 6 // 300 RGB 32 // 310 OLED & RGB 32 @@ -141,5 +135,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/helix/pico/keymaps/biacco/keymap.c b/keyboards/helix/pico/keymaps/biacco/keymap.c index a1d041c022..aa196c7e6a 100644 --- a/keyboards/helix/pico/keymaps/biacco/keymap.c +++ b/keyboards/helix/pico/keymaps/biacco/keymap.c @@ -1,24 +1,19 @@ +/* Copyright 2018 Biacco42 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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 QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif - -extern keymap_config_t keymap_config; - -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - -extern uint8_t is_master; // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. diff --git a/keyboards/helix/pico/keymaps/biacco/rules.mk b/keyboards/helix/pico/keymaps/biacco/rules.mk index 37e49977c5..d971359461 100644 --- a/keyboards/helix/pico/keymaps/biacco/rules.mk +++ b/keyboards/helix/pico/keymaps/biacco/rules.mk @@ -10,15 +10,9 @@ AUDIO_ENABLE = yes # Audio output on port B5 LTO_ENABLE = no # if firmware size over limit, try this option # Helix Spacific Build Options -# you can uncomment and edit follows 6 Variables -# jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 -# OLED_ENABLE = no # OLED_ENABLE -# LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +# you can uncomment and edit follows 4 Variables +# jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = no # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c index 7cc3cb586e..ab68bc5243 100644 --- a/keyboards/helix/pico/keymaps/default/keymap.c +++ b/keyboards/helix/pico/keymaps/default/keymap.c @@ -1,24 +1,25 @@ +/* Copyright 2018 MakotoKurauchi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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 QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif - #ifdef RGBLIGHT_ENABLE //Following line allows macro to read current RGB settings extern rgblight_config_t rgblight_config; #endif -extern uint8_t is_master; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -66,11 +67,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +[_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Colemak * ,-----------------------------------------. ,-----------------------------------------. @@ -83,11 +84,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_COLEMAK] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Dvorak @@ -101,11 +102,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_DVORAK] = LAYOUT( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -119,11 +120,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -137,11 +138,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -155,11 +156,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT( \ - _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, AU_ON, AU_OFF, MU_TOG, MU_MOD, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, CK_TOGG, CK_RST, CK_UP, CK_DOWN, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ + [_ADJUST] = LAYOUT( + _______, QK_BOOT, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, AU_ON, AU_OFF, MU_TOG, MU_MOD, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, + _______, CK_TOGG, CK_RST, CK_UP, CK_DOWN, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD ) }; @@ -334,10 +335,6 @@ void matrix_init_user(void) { #ifdef RGBLIGHT_ENABLE RGB_current_mode = rgblight_config.mode; #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif } @@ -365,105 +362,3 @@ void music_scale_user(void) } #endif - - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED - -void matrix_scan_user(void) { - iota_gfx_task(); // this is what updates the display continuously -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_LOWER (1<<_LOWER) -#define L_RAISE (1<<_RAISE) -#define L_ADJUST (1<<_ADJUST) -#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) - -static void render_logo(struct CharacterMatrix *matrix) { - - static char logo[]={ - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - matrix_write(matrix, logo); - //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); -} - - - -void render_status(struct CharacterMatrix *matrix) { - - // Render to mode icon - static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - matrix_write(matrix, logo[0][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); - }else{ - matrix_write(matrix, logo[1][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - char buf[40]; - snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); - matrix_write_P(matrix, PSTR("\nLayer: ")); - switch (layer_state) { - case L_BASE: - matrix_write_P(matrix, PSTR("Default")); - break; - case L_RAISE: - matrix_write_P(matrix, PSTR("Raise")); - break; - case L_LOWER: - matrix_write_P(matrix, PSTR("Lower")); - break; - case L_ADJUST: - case L_ADJUST_TRI: - matrix_write_P(matrix, PSTR("Adjust")); - break; - default: - matrix_write(matrix, buf); - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", - (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", - (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); - matrix_write(matrix, led); -} - - -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif - - matrix_clear(&matrix); - if(is_master){ - render_status(&matrix); - }else{ - render_logo(&matrix); - } - matrix_update(&display, &matrix); -} - -#endif diff --git a/keyboards/helix/pico/keymaps/default/readme.md b/keyboards/helix/pico/keymaps/default/readme.md index 789097021b..a6c81651a3 100644 --- a/keyboards/helix/pico/keymaps/default/readme.md +++ b/keyboards/helix/pico/keymaps/default/readme.md @@ -96,10 +96,8 @@ see `qmk_firmware/keyboards/helix/pico/keymaps/default/rules.mk` ``` # Helix Spacific Build Options -# you can uncomment and edit follows 6 Variables -# jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 -# OLED_ENABLE = no # OLED_ENABLE -# LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +# you can uncomment and edit follows 4 Variables +# jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations diff --git a/keyboards/helix/pico/keymaps/default/readme_jp.md b/keyboards/helix/pico/keymaps/default/readme_jp.md index 28594dafcb..73f97ad9a6 100644 --- a/keyboards/helix/pico/keymaps/default/readme_jp.md +++ b/keyboards/helix/pico/keymaps/default/readme_jp.md @@ -58,16 +58,13 @@ ## カスタマイズ -オプションの OLED をつけたり、 RGB バックライトまたは、RGB Underglow をつけた場合は、 `qmk_firmware/keyboards/helix/pico/keymaps/default/rules.mk` の以下の部分を編集して機能を有効化してください。 ``` # Helix Spacific Build Options -# you can uncomment and edit follows 6 Variables -# jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 -# OLED_ENABLE = no # OLED_ENABLE -# LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +# you can uncomment and edit follows 4 Variables +# jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations @@ -89,13 +86,6 @@ rules.mk の下記の部分を編集して no を yes に変更してくださ LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) ``` -## OLEDを有効にする - -rules.mk の下記の部分を編集して no を yes に変更してください。 -``` -OLED_ENABLE = yes # OLED_ENABLE -``` - ## iPad/iPhoneサポートを有効にする。 rules.mk の下記の部分を編集して no を yes に変更してください。 diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk index fcf92e6717..9a29406c17 100644 --- a/keyboards/helix/pico/keymaps/default/rules.mk +++ b/keyboards/helix/pico/keymaps/default/rules.mk @@ -1,24 +1,11 @@ -# QMK Standard Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -# See TOP/keyboards/helix/rules.mk for a list of options that can be set. -# See TOP/docs/config_options.md for more information. -# EXTRAKEY_ENABLE = yes # Audio control and System control AUDIO_ENABLE = yes # Audio output LTO_ENABLE = no # if firmware size over limit, try this option # Helix Spacific Build Options -# you can uncomment and edit follows 6 Variables -# jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 -# OLED_ENABLE = no # OLED_ENABLE -# LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +# you can uncomment and edit follows 4 Variables +# jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/keymaps/mtei/config.h b/keyboards/helix/pico/keymaps/mtei/config.h index c5812de8d7..1a4dc2c842 100644 --- a/keyboards/helix/pico/keymaps/mtei/config.h +++ b/keyboards/helix/pico/keymaps/mtei/config.h @@ -1,25 +1,7 @@ -/* -This is the c configuration file for the keymap +// Copyright (c) 2022 Takeshi Ishii (mtei@github) +// SPDX-License-Identifier: GPL-2.0-or-later -Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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 CONFIG_USER_H -#define CONFIG_USER_H +#pragma once // place overrides here @@ -36,17 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // If you need more program area, try select and reduce rgblight modes to use. -// Selection of RGBLIGHT MODE to use. -#if defined(LED_ANIMATIONS) - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - //#define RGBLIGHT_EFFECT_SNAKE - //#define RGBLIGHT_EFFECT_KNIGHT - #define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - //#define RGBLIGHT_EFFECT_RGB_TEST - //#define RGBLIGHT_EFFECT_ALTERNATING -#endif - -#endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/pico/keymaps/mtei/keymap.c b/keyboards/helix/pico/keymaps/mtei/keymap.c index 728ef0eb5f..b703ca376d 100644 --- a/keyboards/helix/pico/keymaps/mtei/keymap.c +++ b/keyboards/helix/pico/keymaps/mtei/keymap.c @@ -1,31 +1,24 @@ +/* Copyright 2018 mtei + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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 QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif -#ifdef CONSOLE_ENABLE - #include <print.h> -#endif +#include "key_blocks.h" #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define kc5(a,b,c,d,e) KC_##a, KC_##b, KC_##c, KC_##d, KC_##e -extern keymap_config_t keymap_config; - -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - -extern uint8_t is_master; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -67,12 +60,6 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty */ -#define Q_____W_____E_____R_____T kc5( Q, W, E, R, T ) -#define Y_____U_____I_____O_____P kc5( Y, U, I, O, P ) -#define A_____S_____D_____F_____G kc5( A, S, D, F, G ) -#define H_____J_____K_____L__SCLN kc5( H, J, K, L, SCLN ) -#define Z_____X_____C_____V_____B kc5( Z, X, C, V, B ) -#define N_____M__COMM___DOT__SLSH kc5( N, M, COMM, DOT, SLSH ) #define LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS MO(_LOWER), MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, LT_NUML_SP, LT_RA_BSPC #define RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER LT_RA_ENT, LT_NUMR_SP, KC_RGUI, KC_RALT, KC_APP, MO(_LOWER), MO(_LOWER) /* ,-----------------------------------------. ,-----------------------------------------. @@ -86,18 +73,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_wrapper( - KC_ESC, Q_____W_____E_____R_____T, Y_____U_____I_____O_____P, KC_BSLS, - KC_LCTL, A_____S_____D_____F_____G, H_____J_____K_____L__SCLN, KC_RCTL, - KC_LSFT, Z_____X_____C_____V_____B, N_____M__COMM___DOT__SLSH, KC_RSFT, + KC_ESC, Q_____W_____E_____R_____T, Y_____U_____I_____O_____P, KC_BSLS, + KC_LCTL, A_____S_____D_____F_____G, H_____J_____K_____L____SCLN, KC_RCTL, + KC_LSFT, Z_____X_____C_____V_____B, N_____M____COMM__DOT___SLSH, KC_RSFT, LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER ), /* Colemak */ -#define Q_____W_____F_____P_____G kc5( Q, W, F, P, G ) -#define J_____L_____U_____Y__SCLN kc5( J, L, U, Y, SCLN ) -#define A_____R_____S_____T_____D kc5( A, R, S, T, D ) -#define H_____N_____E_____I_____O kc5( H, N, E, I, O ) -#define K_____M__COMM___DOT__SLSH kc5( K, M, COMM, DOT, SLSH ) /* ,-----------------------------------------. ,-----------------------------------------. * | ESC | Q | W | F | P | G | | J | L | U | Y | ; | \ | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -109,19 +91,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_COLEMAK] = LAYOUT_wrapper( - KC_ESC, Q_____W_____F_____P_____G, J_____L_____U_____Y__SCLN, KC_BSLS, - KC_LCTL, A_____R_____S_____T_____D, H_____N_____E_____I_____O, KC_RCTL, - KC_LSFT, Z_____X_____C_____V_____B, K_____M__COMM___DOT__SLSH, KC_RSFT, + KC_ESC, Q_____W_____F_____P_____G, J_____L_____U_____Y____SCLN, KC_BSLS, + KC_LCTL, A_____R_____S_____T_____D, H_____N_____E_____I_____O, KC_RCTL, + KC_LSFT, Z_____X_____C_____V_____B, K_____M____COMM__DOT___SLSH, KC_RSFT, LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER ), /* Dvorak */ -#define QUOT__COMM___DOT_____P_____Y kc5( QUOT, COMM, DOT, P, Y ) -#define F_____G_____C_____R_____L kc5( F, G, C, R, L ) -#define A_____O_____E_____U_____I kc5( A, O, E, U, I ) -#define D_____H_____T_____N_____S kc5( D, H, T, N, S ) -#define SCLN_____Q_____J_____K_____X kc5( SCLN, Q, J, K, X ) -#define B_____M_____W_____V_____Z kc5( B, M, W, V, Z ) /* ,-----------------------------------------. ,-----------------------------------------. * | ESC | ' | , | . | P | Y | | F | G | C | R | L | \ | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -133,19 +109,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_DVORAK] = LAYOUT_wrapper( - KC_ESC, QUOT__COMM___DOT_____P_____Y, F_____G_____C_____R_____L, KC_BSLS, - KC_LCTL, A_____O_____E_____U_____I, D_____H_____T_____N_____S, KC_RCTL, - KC_LSFT, SCLN_____Q_____J_____K_____X, B_____M_____W_____V_____Z, KC_RSFT, + KC_ESC, QUOT_COMM___DOT____P_____Y, F_____G_____C_____R_____L, KC_BSLS, + KC_LCTL, A_____O_____E_____U_____I, D_____H_____T_____N_____S, KC_RCTL, + KC_LSFT, SCLN___Q_____J_____K_____X, B_____M_____W_____V_____Z, KC_RSFT, LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER ), /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) */ -#define Q_____W__COMM___DOT__SCLN kc5( Q, W, COMM, DOT, SCLN ) -#define M_____R_____D_____Y_____P kc5( M, R, D, Y, P ) -#define A_____O_____E_____I_____U kc5( A, O, E, I, U ) -#define G_____T_____K_____S_____N kc5( G, T, K, S, N ) -#define Z_____X_____C_____V_____F kc5( Z, X, C, V, F ) -#define B_____H_____J_____L__SLSH kc5( B, H, J, L, SLSH ) /* ,-----------------------------------------. ,-----------------------------------------. * | ESC | Q | W | , | . | ; | | M | R | D | Y | P | \ | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -157,19 +127,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_EUCALYN] = LAYOUT_wrapper( - KC_ESC, Q_____W__COMM___DOT__SCLN, M_____R_____D_____Y_____P, KC_BSLS, - KC_LCTL, A_____O_____E_____I_____U, G_____T_____K_____S_____N, KC_RCTL, - KC_LSFT, Z_____X_____C_____V_____F, B_____H_____J_____L__SLSH, KC_RSFT, + KC_ESC, Q_____W___COMM___DOT__SCLN, M_____R_____D_____Y_____P, KC_BSLS, + KC_LCTL, A_____O_____E_____I_____U, G_____T_____K_____S_____N, KC_RCTL, + KC_LSFT, Z_____X_____C_____V_____F, B_____H_____J_____L____SLSH, KC_RSFT, LOWER___LOWER__CAPS__LALT__LGUI__NUML__RABS, RAEN_NUMR__RGUI__RALT___APP_LOWER__LOWER ), /* Num */ #define EXLM__AT__HASH___DLR__PERC kc5( EXLM, AT, HASH, DLR, PERC ) #define CIRC_AMPR_ASTR__LPRN__RPRN kc5( CIRC, AMPR, ASTR, LPRN, RPRN ) -#define _1_____2_____3_____4_____5 kc5( 1, 2, 3, 4, 5 ) -#define _6_____7_____8_____9_____0 kc5( 6, 7, 8, 9, 0 ) -#define F1____F2____F3____F4____F5 kc5( F1, F2, F3, F4, F5 ) -#define F6____F7____F8____F9___F10 kc5( F6, F7, F8, F9, F10 ) #define ____z_____z_____z_____z _______, _______, _______, _______ #define ____z_____z_____z _______, _______, _______ #define ____z_____z _______, _______ @@ -186,13 +152,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUML] = LAYOUT_wrapper( _______, EXLM__AT__HASH___DLR__PERC, CIRC_AMPR_ASTR__LPRN__RPRN, _______, _______, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_F12, - _______, F1____F2____F3____F4____F5, F6____F7____F8____F9___F10, KC_F11, + _______, F1____F2____F3____F4____F5, F6____F7____F8____F9____F10, KC_F11, _______, ____z_____z_____z_____z,____z_____z_____z,KC_SPC, ____z_____z_____z_____z, _______ ), [_NUMR] = LAYOUT_wrapper( _______, EXLM__AT__HASH___DLR__PERC, CIRC_AMPR_ASTR__LPRN__RPRN, _______, _______, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_F12, - _______, F1____F2____F3____F4____F5, F6____F7____F8____F9___F10, KC_F11, + _______, F1____F2____F3____F4____F5, F6____F7____F8____F9____F10, KC_F11, _______, ____z_____z_____z_____z,KC_SPC, ____z_____z_____z,____z_____z_____z_____z, _______ ), /* Lower */ @@ -373,10 +339,6 @@ void matrix_init_user(void) { #ifdef AUDIO_ENABLE startup_user(); #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif } @@ -404,124 +366,3 @@ void music_scale_user(void) } #endif - - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED - -void matrix_scan_user(void) { - iota_gfx_task(); // this is what updates the display continuously -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -static void render_logo(struct CharacterMatrix *matrix) { - - static char logo[]={ - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - matrix_write(matrix, logo); -#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_ANIMATIONS) - char buf[30]; - if(rgblight_config.enable) { - snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", - rgblight_config.mode, - rgblight_config.hue/RGBLIGHT_HUE_STEP, - rgblight_config.sat/RGBLIGHT_SAT_STEP, - rgblight_config.val/RGBLIGHT_VAL_STEP); - matrix_write(matrix, buf); - } -#endif - //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); -} - -static const char Qwerty_name[] PROGMEM = " Qwerty"; -static const char Colemak_name[] PROGMEM = " Colemak"; -static const char Dvorak_name[] PROGMEM = " Dvorak"; -static const char Eucalyn_name[] PROGMEM = " Eucalyn"; - -static const char NumL_name[] PROGMEM = ":NumL"; -static const char NumR_name[] PROGMEM = ":NumR"; -static const char Lower_name[] PROGMEM = ":Func"; -static const char Raise_name[] PROGMEM = ":Extra"; -static const char Adjust_name[] PROGMEM = ":Adjust"; - -static const char *layer_names[] = { - [_QWERTY] = Qwerty_name, - [_COLEMAK] = Colemak_name, - [_DVORAK] = Dvorak_name, - [_EUCALYN] = Eucalyn_name, - - [_NUML] = NumL_name, - [_NUMR] = NumR_name, - [_LOWER] = Lower_name, - [_RAISE] = Raise_name, - [_ADJUST] = Adjust_name -}; - -void render_status(struct CharacterMatrix *matrix) { - - // Render to mode icon - static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - matrix_write(matrix, logo[0][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); - }else{ - matrix_write(matrix, logo[1][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - int name_num; - uint32_t lstate; - matrix_write_P(matrix, layer_names[current_default_layer]); - matrix_write_P(matrix, PSTR("\n")); - for( lstate = layer_state, name_num = 0; - lstate && name_num < sizeof(layer_names)/sizeof(char *); - lstate >>=1, name_num++ ) { - if( (lstate & 1) != 0 ) { - if( layer_names[name_num] ) { - matrix_write_P(matrix, layer_names[name_num]); - } - } - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", - (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", - (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); - matrix_write(matrix, led); -} - - -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif - - matrix_clear(&matrix); - if(is_master){ - render_status(&matrix); - }else{ - render_logo(&matrix); - } - matrix_update(&display, &matrix); -} - -#endif diff --git a/keyboards/helix/pico/keymaps/mtei/rules.mk b/keyboards/helix/pico/keymaps/mtei/rules.mk index 165233f5fe..413d0519d6 100644 --- a/keyboards/helix/pico/keymaps/mtei/rules.mk +++ b/keyboards/helix/pico/keymaps/mtei/rules.mk @@ -10,15 +10,9 @@ AUDIO_ENABLE = yes # Audio output on port B5 LTO_ENABLE = no # if firmware size over limit, try this option # Helix Spacific Build Options -# you can uncomment and edit follows 6 Variables -# jp: 以下の6つの変数を必要に応じて編集し、コメントアウトをはずします。 -# OLED_ENABLE = no # OLED_ENABLE -# LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +# you can uncomment and edit follows 4 Variables +# jp: 以下の4つの変数を必要に応じて編集し、コメントアウトをはずします。 # LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/local_features.mk b/keyboards/helix/pico/local_features.mk deleted file mode 100644 index be5c739f97..0000000000 --- a/keyboards/helix/pico/local_features.mk +++ /dev/null @@ -1,149 +0,0 @@ -# -# local_features.mk contains post-processing rules for the Helix keyboard. -# -# Post-processing rules convert keyboard-specific shortcuts (that represent -# combinations of standard options) into QMK standard options. -# - -KEYBOARD_LOCAL_FEATURES_MK := - -define HELIX_CUSTOMISE_MSG - $(info Helix Spacific Build Options) - $(info - OLED_ENABLE = $(OLED_ENABLE)) - $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) - $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) - $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) - $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) - $(info ) -endef - -define HELIX_HELP_MSG - $(info Helix keyboard convenient command line option) - $(info - make HELIX=<options> helix/pico:<keymap>) - $(info - option= oled | back | under | na | no-ani) - $(info - ios | sc | split-common | scan | verbose) - $(info - ex.) - $(info - make HELIX=oled helix/pico:<keymap>) - $(info - make HELIX=back helix/pico:<keymap>) - $(info - make HELIX=under helix/pico:<keymap>) - $(info - make HELIX=back,na helix/pico:<keymap>) - $(info - make HELIX=back,ios helix/pico:<keymap>) - $(info ) -endef - - ifneq ($(strip $(HELIX)),) - COMMA=, - helix_option := $(subst $(COMMA), , $(HELIX)) - ifneq ($(filter help,$(helix_option)),) - $(eval $(call HELIX_HELP_MSG)) - $(error ) - endif - ifneq ($(filter oled,$(helix_option)),) - OLED_ENABLE = yes - endif - ifneq ($(filter back,$(helix_option)),) - LED_BACK_ENABLE = yes - else ifneq ($(filter under,$(helix_option)),) - LED_UNDERGLOW_ENABLE = yes - endif - ifneq ($(filter na,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter no_ani,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter no-ani,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter ios,$(helix_option)),) - IOS_DEVICE_ENABLE = yes - endif - ifneq ($(filter sc,$(helix_option)),) - SPLIT_KEYBOARD = yes - endif - ifneq ($(filter split-common,$(helix_option)),) - SPLIT_KEYBOARD = yes - endif - ifneq ($(filter scan,$(helix_option)),) - # use DEBUG_MATRIX_SCAN_RATE - # see docs/newbs_testing_debugging.md - OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE - CONSOLE_ENABLE = yes - SHOW_VERBOSE_INFO = yes - endif - ifneq ($(filter verbose,$(helix_option)),) - SHOW_VERBOSE_INFO = yes - endif - SHOW_HELIX_OPTIONS = yes - endif - -ifneq ($(strip $(SPLIT_KEYBOARD)), yes) - SRC += local_drivers/serial.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - - # A workaround until #7089 is merged. - # serial.c must not be compiled with the -lto option. - # The current LIB_SRC has a side effect with the -fno-lto option, so use it. - LIB_SRC += local_drivers/serial.c - - CUSTOM_MATRIX = yes - - SRC += pico/matrix.c - SRC += pico/split_util.c -endif - -######## -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. - -ifeq ($(strip $(LED_BACK_ENABLE)), yes) - RGBLIGHT_ENABLE = yes - OPT_DEFS += -DRGBLED_BACK - ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) - $(eval $(call HELIX_CUSTOMISE_MSG)) - $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') - endif -else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) - RGBLIGHT_ENABLE = yes -endif - -ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) - OPT_DEFS += -DIOS_DEVICE_ENABLE -endif - -ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DLED_ANIMATIONS -endif - -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += local_drivers/i2c.c - SRC += local_drivers/ssd1306.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - OPT_DEFS += -DOLED_ENABLE - ifeq ($(strip $(LOCAL_GLCDFONT)), yes) - OPT_DEFS += -DLOCAL_GLCDFONT - endif -endif - -ifeq ($(strip $(AUDIO_ENABLE)),yes) - ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) - LTO_ENABLE = yes - endif - ifeq ($(strip $(OLED_ENABLE)),yes) - LTO_ENABLE = yes - endif -endif - -ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) - $(eval $(call HELIX_CUSTOMISE_MSG)) - ifneq ($(strip $(SHOW_VERBOSE_INFO)),) - $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) - $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) - $(info -- OPT_DEFS = $(OPT_DEFS)) - $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) - $(info -- LTO_ENABLE = $(LTO_ENABLE)) - $(info ) - endif -endif - -OLED_ENABLE = no # disable OLED in TOP/common_features.mk diff --git a/keyboards/helix/pico/matrix.c b/keyboards/helix/pico/matrix.c deleted file mode 100644 index b18213d846..0000000000 --- a/keyboards/helix/pico/matrix.c +++ /dev/null @@ -1,342 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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/>. -*/ - -/* - * scan matrix - */ -#include <stdint.h> -#include <stdbool.h> -#include <avr/io.h> -#include <avr/wdt.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "quantum.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); -static uint8_t matrix_master_scan(void); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - split_keyboard_setup(); - - // initialize row and col - unselect_rows(); - init_cols(); - - setPinOutput(B0); - setPinOutput(D5); - writePinHigh(B0); - writePinHigh(D5); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matirx so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_MATRIX_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - int ret=serial_update_buffers(); - if (ret ) { - if(ret==2) writePinLow(B0); - return 1; - } - writePinHigh(B0); - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - if (is_helix_master()) { - matrix_master_scan(); - }else{ - matrix_slave_scan(); - - int offset = (isLeftHand) ? ROWS_PER_HAND : 0; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[offset+i] = serial_master_buffer[i]; - } - - matrix_scan_quantum(); - } - return 1; -} - - -uint8_t matrix_master_scan(void) { - - int ret = _matrix_scan(); - -#ifndef KEYBOARD_helix_rev1 - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_MATRIX_I2C -// for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; -// } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_master_buffer[i] = matrix[offset+i]; - } -#endif -#endif - -#ifdef USE_MATRIX_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - writePinLow(D5); - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - writePinHigh(D5); - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_MATRIX_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<<col)); -} - -inline -matrix_row_t matrix_get_row(uint8_t row) -{ - return matrix[row]; -} - -void matrix_print(void) -{ - print("\nr/c 0123456789ABCDEF\n"); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - print_hex8(row); print(": "); - print_bin_reverse16(matrix_get_row(row)); - print("\n"); - } -} - -uint8_t matrix_key_count(void) -{ - uint8_t count = 0; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - count += bitpop16(matrix[i]); - } - return count; -} - -static void init_cols(void) -{ - for(int x = 0; x < MATRIX_COLS; x++) { - _SFR_IO8((col_pins[x] >> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/helix/pico/override_helix_options.mk-maintenance b/keyboards/helix/pico/override_helix_options.mk-maintenance new file mode 100644 index 0000000000..0ff930957e --- /dev/null +++ b/keyboards/helix/pico/override_helix_options.mk-maintenance @@ -0,0 +1,42 @@ +# +# This file is not normally used. It is used for maintenance testing purposes. +# To use it, do the following: +# +# $ cp override_helix_options.mk-maintenance override_helix_options.mk +# +$(info -------------------------) +$(info override_helix_options.mk) +$(info -------------------------) + +define HELIX_OVERRIDE_PARSE + ifeq ($(strip $1),back) + LED_BACK_ENABLE = yes + LED_UNDERGLOW_ENABLE = no + endif + ifeq ($(strip $1),under) + LED_BACK_ENABLE = no + LED_UNDERGLOW_ENABLE = yes + endif + ifneq ($(filter noled led-off led_off,$(strip $1)),) + LED_BACK_ENABLE = no + LED_UNDERGLOW_ENABLE = no + endif + ifneq ($(filter noaudio audio-off audio_off,$(strip $1)),) + AUDIO_ENABLE = no + endif + ifneq ($(filter audio audio-on audio_on,$(strip $1)),) + AUDIO_ENABLE = yes + endif + ifneq ($(filter sc split-common split_common,$(strip $1)),) + SPLIT_KEYBOARD = yes + endif + ifneq ($(filter nosc no-sc no-split-common no-split_common,$(strip $1)),) + SPLIT_KEYBOARD = no + endif + ifeq ($(strip $1),scan) + DEBUG_MATRIX_SCAN_RATE_ENABLE = yes + endif + ifeq ($(strip $1),scan-api) + DEBUG_MATRIX_SCAN_RATE_ENABLE = api + endif +endef # end of HELIX_OVERRIDE_PARSE diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c index 315b35a7ae..4cd1953632 100644 --- a/keyboards/helix/pico/pico.c +++ b/keyboards/helix/pico/pico.c @@ -1,3 +1,18 @@ +/* Copyright 2018 MakotoKurauchi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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 "helix.h" // Each keymap.c should use is_keyboard_master() instead of 'is_master'. @@ -5,14 +20,6 @@ // for the old keymap.c. uint8_t is_master = false; -#ifdef SSD1306OLED -#include "ssd1306.h" - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_gfx(keycode,record) && process_record_user(keycode, record); -} -#endif - void matrix_init_kb(void) { // Each keymap.c should use is_keyboard_master() instead of is_master. // But keep is_master for a while for backwards compatibility @@ -28,9 +35,3 @@ void keyboard_post_init_kb(void) { #endif keyboard_post_init_user(); } - -#if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED) -void matrix_slave_scan_user(void) { - matrix_scan_user(); -} -#endif diff --git a/keyboards/helix/pico/pico.h b/keyboards/helix/pico/pico.h index 5fa5f72958..3e51d54d84 100644 --- a/keyboards/helix/pico/pico.h +++ b/keyboards/helix/pico/pico.h @@ -1,12 +1,22 @@ +/* Copyright 2018 MakotoKurauchi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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/>. + */ #pragma once #include "helix.h" -#ifndef SPLIT_KEYBOARD - extern bool is_helix_master(void); - #define is_keyboard_master() is_helix_master() -#endif - // Each keymap.c should use is_keyboard_master() instead of 'is_master', 'has_usb()'. // But keep 'is_master' for a while for backwards compatibility // for the old keymap.c. diff --git a/keyboards/helix/pico/post_rules.mk b/keyboards/helix/pico/post_rules.mk new file mode 100644 index 0000000000..88bb5482ba --- /dev/null +++ b/keyboards/helix/pico/post_rules.mk @@ -0,0 +1,77 @@ +# +# post_rules.mk contains post-processing rules for the Helix keyboard. +# +# Post-processing rules convert keyboard-specific shortcuts (that represent +# combinations of standard options) into QMK standard options. +# +-include $(strip $(HELIX_TOP_DIR)/pico/override_helix_options.mk) ## File dedicated to maintenance + +# Parse 'HELIX=xx,yy,zz' option +ifneq ($(strip $(HELIX)),) + # make HELIX=ios helix/pico:AKEYMAP + # make HELIX=no-ani helix/pico:AKEYMAP + # make HELIX=ios,no-ani helix/pico:AKEYMAP + define HELIX_OPTION_PARSE + # parce 'no-ani' 'ios' + $(if $(SHOW_PARCE),$(info parse .$1.)) #debug + $(if $(HELIX_OVERRIDE_PARSE),$(call HELIX_OVERRIDE_PARSE,$1)) + + ifeq ($(strip $1),ios) + IOS_DEVICE_ENABLE = yes + endif + ifneq ($(filter na no_ani no-ani,$(strip $1)),) + LED_ANIMATIONS = no + endif + endef # end of HELIX_OPTION_PARSE + + COMMA=, + $(eval $(foreach A_OPTION_NAME,$(subst $(COMMA), ,$(HELIX)), \ + $(call HELIX_OPTION_PARSE,$(A_OPTION_NAME)))) + SHOW_HELIX_OPTIONS = yes +endif + +######## +# convert Helix-specific options (that represent combinations of standard options) +# into QMK standard options. + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(AUDIO_ENABLE)),yes) + ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) + LTO_ENABLE = yes + endif +endif + +ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) + $(info Helix Spacific Build Options) + $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) + $(info ) + $(info QMK Build Options) + $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) + $(info -- AUDIO_ENABLE = $(AUDIO_ENABLE)) + $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) + $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) + $(info -- OPT_DEFS = $(OPT_DEFS)) + $(info -- LTO_ENABLE = $(LTO_ENABLE)) + $(info -- DEBUG_MATRIX_SCAN_RATE_ENABLE = $(DEBUG_MATRIX_SCAN_RATE_ENABLE)) + $(info ) +endif diff --git a/keyboards/helix/pico/qmk_conf/rules.mk b/keyboards/helix/pico/qmk_conf/rules.mk index e2993b3f80..08ca8e094d 100644 --- a/keyboards/helix/pico/qmk_conf/rules.mk +++ b/keyboards/helix/pico/qmk_conf/rules.mk @@ -1,4 +1,2 @@ EXTRAKEY_ENABLE = yes # Audio control and System control AUDIO_ENABLE = yes # Audio output - -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/rules.mk b/keyboards/helix/pico/rules.mk index cb9a70e00e..efa7ae4be5 100644 --- a/keyboards/helix/pico/rules.mk +++ b/keyboards/helix/pico/rules.mk @@ -1,8 +1,6 @@ -KEYBOARD_LOCAL_FEATURES_MK := $(dir $(lastword $(MAKEFILE_LIST)))local_features.mk +SPLIT_KEYBOARD = yes # Helix Spacific Build Options default values -OLED_ENABLE = no # OLED_ENABLE -LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations diff --git a/keyboards/helix/pico/split_util.c b/keyboards/helix/pico/split_util.c deleted file mode 100644 index c77e63f33c..0000000000 --- a/keyboards/helix/pico/split_util.c +++ /dev/null @@ -1,104 +0,0 @@ -#include <avr/io.h> -#include <avr/wdt.h> -#include <avr/power.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include <avr/eeprom.h> -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "wait.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -#ifdef EE_HANDS -# include "eeconfig.h" -#endif - -#ifndef SPLIT_USB_TIMEOUT - #define SPLIT_USB_TIMEOUT 2500 -#endif - -volatile bool isLeftHand = true; - -bool waitForUsb(void) { - for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / 100); i++) { - // This will return true of a USB connection has been established - if (UDADDR & _BV(ADDEN)) { - return true; - } - wait_ms(100); - } - - // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow - (USBCON &= ~(_BV(USBE) | _BV(OTGPADE))); - - return false; -} - -bool is_keyboard_left(void) { -#if defined(SPLIT_HAND_PIN) - // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand - setPinInput(SPLIT_HAND_PIN); - return readPin(SPLIT_HAND_PIN); -#elif defined(EE_HANDS) - return eeconfig_read_handedness(); -#elif defined(MASTER_RIGHT) - return !is_helix_master(); -#endif - - return is_helix_master(); -} - -bool is_helix_master(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; - - // only check once, as this is called often - if (usbstate == UNKNOWN) { -#if defined(SPLIT_USB_DETECT) - usbstate = waitForUsb() ? MASTER : SLAVE; -#elif defined(__AVR__) - USBCON |= (1 << OTGPADE); // enables VBUS pad - wait_us(5); - - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS -#else - usbstate = MASTER; -#endif - } - - return (usbstate == MASTER); - } - -static void keyboard_master_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_master_init(); -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -void split_keyboard_setup(void) { - isLeftHand = is_keyboard_left(); - - if (is_helix_master()) { - keyboard_master_setup(); - } else { - keyboard_slave_setup(); - } - sei(); -} diff --git a/keyboards/helix/pico/split_util.h b/keyboards/helix/pico/split_util.h deleted file mode 100644 index c0ecdb0974..0000000000 --- a/keyboards/helix/pico/split_util.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SPLIT_KEYBOARD_UTIL_H -#define SPLIT_KEYBOARD_UTIL_H - -#include <stdbool.h> -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool is_helix_master(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/helix/rev1/.noci b/keyboards/helix/rev1/.noci deleted file mode 100644 index e69de29bb2..0000000000 --- a/keyboards/helix/rev1/.noci +++ /dev/null diff --git a/keyboards/helix/rev1/config.h b/keyboards/helix/rev1/config.h deleted file mode 100644 index 19d1e3be65..0000000000 --- a/keyboards/helix/rev1/config.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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/>. -*/ - -#pragma once - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x3265 -#define PRODUCT_ID 0x8000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Yushakobo -#define PRODUCT Helix Alpha - -#include "serial_config.h" - -#define HELIX_ROWS 5 - -/* key matrix size */ -// Rows are doubled-up -#if HELIX_ROWS == 3 - #define MATRIX_ROWS 6 - #define MATRIX_ROW_PINS { D7, E6, B4 } -#elif HELIX_ROWS == 4 - #define MATRIX_ROWS 8 - #define MATRIX_ROW_PINS { D7, E6, B4, B5 } -#elif HELIX_ROWS == 5 - #define MATRIX_ROWS 10 - #define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } -#else - #error "expected HELIX_ROWS 3 or 4 or 5" -#endif -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } -// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 - -#define RGBLED_NUM 12 // Number of LEDs -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION diff --git a/keyboards/helix/rev1/info.json b/keyboards/helix/rev1/info.json deleted file mode 100644 index c52da08974..0000000000 --- a/keyboards/helix/rev1/info.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "keyboard_name": "Helix rev. 1", - "url": "https://github.com/MakotoKurauchi/helix", - "maintainer": "MakotoKurauchi", - "layouts": { - "LAYOUT": { - "layout": [ - {"x": 0, "y": 0}, - {"x": 1, "y": 0}, - {"x": 2, "y": 0}, - {"x": 3, "y": 0}, - {"x": 4, "y": 0}, - {"x": 5, "y": 0}, - - {"x": 7, "y": 0}, - {"x": 8, "y": 0}, - {"x": 9, "y": 0}, - {"x": 10, "y": 0}, - {"x": 11, "y": 0}, - {"x": 12, "y": 0}, - - {"x": 0, "y": 1}, - {"x": 1, "y": 1}, - {"x": 2, "y": 1}, - {"x": 3, "y": 1}, - {"x": 4, "y": 1}, - {"x": 5, "y": 1}, - - {"x": 7, "y": 1}, - {"x": 8, "y": 1}, - {"x": 9, "y": 1}, - {"x": 10, "y": 1}, - {"x": 11, "y": 1}, - {"x": 12, "y": 1}, - - {"x": 0, "y": 2}, - {"x": 1, "y": 2}, - {"x": 2, "y": 2}, - {"x": 3, "y": 2}, - {"x": 4, "y": 2}, - {"x": 5, "y": 2}, - - {"x": 7, "y": 2}, - {"x": 8, "y": 2}, - {"x": 9, "y": 2}, - {"x": 10, "y": 2}, - {"x": 11, "y": 2}, - {"x": 12, "y": 2}, - - {"x": 0, "y": 3}, - {"x": 1, "y": 3}, - {"x": 2, "y": 3}, - {"x": 3, "y": 3}, - {"x": 4, "y": 3}, - {"x": 5, "y": 3}, - - {"x": 7, "y": 3}, - {"x": 8, "y": 3}, - {"x": 9, "y": 3}, - {"x": 10, "y": 3}, - {"x": 11, "y": 3}, - {"x": 12, "y": 3}, - - {"x": 0, "y": 4}, - {"x": 1, "y": 4}, - {"x": 2, "y": 4}, - {"x": 3, "y": 4}, - {"x": 4, "y": 4}, - {"x": 5, "y": 4}, - - {"x": 7, "y": 4}, - {"x": 8, "y": 4}, - {"x": 9, "y": 4}, - {"x": 10, "y": 4}, - {"x": 11, "y": 4}, - {"x": 12, "y": 4} - ] - } - } -} diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/config.h b/keyboards/helix/rev1/keymaps/OLED_sample/config.h deleted file mode 100644 index 5e8989d96f..0000000000 --- a/keyboards/helix/rev1/keymaps/OLED_sample/config.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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 CONFIG_USER_H -#define CONFIG_USER_H - -/* Use I2C or Serial */ - -#define USE_I2C -#define USE_SERIAL -//#define USE_MATRIX_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS - -#define SSD1306OLED - -#define USE_SERIAL_PD2 - -#define TAPPING_FORCE_HOLD -#define TAPPING_TERM 100 - - -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 6 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - -#endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c deleted file mode 100644 index 6838b90e5e..0000000000 --- a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c +++ /dev/null @@ -1,471 +0,0 @@ -#include QMK_KEYBOARD_H -#include "bootloader.h" -#include <LUFA/Drivers/Peripheral/TWI.h> -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif - -extern keymap_config_t keymap_config; - -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, - BACKLIT, - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, - M_SAMPLE -}; - -#if MATRIX_ROWS == 10 // HELIX_ROWS == 5 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Colemak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) -}; - -#elif MATRIX_ROWS == 8 // HELIX_ROWS == 4 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - - [_QWERTY] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = LAYOUT( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT( \ - _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) -}; - -#else -#error "undefined keymaps" -#endif - - -#ifdef AUDIO_ENABLE - -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float tone_plover[][2] = SONG(PLOVER_SOUND); -float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -#endif - -// define variables for reactive RGB -bool TOG_STATUS = false; -int RGB_current_mode; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -// Setting ADJUST layer RGB back to default -void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - rgblight_mode(RGB_current_mode); - layer_on(layer3); - } else { - layer_off(layer3); - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(RGBLIGHT_MODE_SNAKE + 1); - } - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - TOG_STATUS = false; - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(RGBLIGHT_MODE_SNAKE); - } - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - layer_off(_RAISE); - TOG_STATUS = false; - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released - case RGB_MOD: - if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - return false; - break; - case M_SAMPLE: - if (record->event.pressed) { - SEND_STRING("hello world"); - } - return false; - } - return true; -} - -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif - RGB_current_mode = rgblight_config.mode; -} - -//SSD1306 OLED init and update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED -void matrix_master_OLED_init (void) { - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(0); // turns on the display -} - -void matrix_scan_user(void) { - iota_gfx_task(); // this is what updates the display continuously -} -#endif - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick -} - -void shutdown_user() -{ - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/readme.md b/keyboards/helix/rev1/keymaps/OLED_sample/readme.md deleted file mode 100644 index 02888855b8..0000000000 --- a/keyboards/helix/rev1/keymaps/OLED_sample/readme.md +++ /dev/null @@ -1,25 +0,0 @@ -SSD1306 OLED Display via I2C -====== - -Features --------- - -Some features supported by the firmware: - - -* I2C connection between the two halves is required as the OLED display will use this connection as well. Note this - requires pull-up resistors on the data and clock lines. -* OLED display will connect from either side - - -Wiring ------- - - -Work in progress... - - -OLED Configuration -------------------------------- - -Work in progress... diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk deleted file mode 100644 index 69170e35c3..0000000000 --- a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -EXTRAKEY_ENABLE = yes -NKRO_ENABLE = yes -RGBLIGHT_ENABLE = yes -SWAP_HANDS_ENABLE = no diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h deleted file mode 100644 index f56951e707..0000000000 --- a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h +++ /dev/null @@ -1,9 +0,0 @@ -//// #error rev1/keymaps/OLED_sample serial config - -#ifndef SOFT_SERIAL_PIN -/* Soft Serial defines */ -#define SOFT_SERIAL_PIN D2 - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 0 -#endif diff --git a/keyboards/helix/rev1/keymaps/default/config.h b/keyboards/helix/rev1/keymaps/default/config.h deleted file mode 100644 index 0f81f5f7be..0000000000 --- a/keyboards/helix/rev1/keymaps/default/config.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2015 Jack Humbert - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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/>. -*/ - -#pragma once - -// place overrides here - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS diff --git a/keyboards/helix/rev1/keymaps/default/keymap.c b/keyboards/helix/rev1/keymaps/default/keymap.c deleted file mode 100644 index 85391f8f60..0000000000 --- a/keyboards/helix/rev1/keymaps/default/keymap.c +++ /dev/null @@ -1,342 +0,0 @@ -#include QMK_KEYBOARD_H - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, -}; - -#if MATRIX_ROWS == 10 // HELIX_ROWS == 5 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Colemak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) -}; - -#elif MATRIX_ROWS == 8 // HELIX_ROWS == 4 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - - [_QWERTY] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_COLEMAK] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ - [_DVORAK] = LAYOUT( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ - ), - - /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ - [_ADJUST] = LAYOUT( \ - _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) -}; - -#else -#error "undefined keymaps" -#endif - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/helix/rev1/matrix.c b/keyboards/helix/rev1/matrix.c deleted file mode 100644 index aa2cc76905..0000000000 --- a/keyboards/helix/rev1/matrix.c +++ /dev/null @@ -1,308 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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/>. -*/ - -/* - * scan matrix - */ -#include <stdint.h> -#include <stdbool.h> -#include <avr/io.h> -#include <avr/wdt.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "config.h" -#include "quantum.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - setPinOutput(B0); - setPinOutput(D5); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matirx so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_MATRIX_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - int ret = _matrix_scan(); - - - -#ifdef USE_MATRIX_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - writePinLow(D5); - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - writePinHigh(D5); - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); - -#ifdef USE_MATRIX_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<<col)); -} - -inline -matrix_row_t matrix_get_row(uint8_t row) -{ - return matrix[row]; -} - -void matrix_print(void) -{ - print("\nr/c 0123456789ABCDEF\n"); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - print_hex8(row); print(": "); - print_bin_reverse16(matrix_get_row(row)); - print("\n"); - } -} - -uint8_t matrix_key_count(void) -{ - uint8_t count = 0; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - count += bitpop16(matrix[i]); - } - return count; -} - -static void init_cols(void) -{ - for(int x = 0; x < MATRIX_COLS; x++) { - _SFR_IO8((col_pins[x] >> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/helix/rev1/rev1.c b/keyboards/helix/rev1/rev1.c deleted file mode 100644 index d053f0de17..0000000000 --- a/keyboards/helix/rev1/rev1.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "helix.h" - - -#ifdef SSD1306OLED -#include "ssd1306.h" - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_gfx(keycode,record) && process_record_user(keycode, record); -} -#endif diff --git a/keyboards/helix/rev1/rev1.h b/keyboards/helix/rev1/rev1.h deleted file mode 100644 index 7db27bcca0..0000000000 --- a/keyboards/helix/rev1/rev1.h +++ /dev/null @@ -1,129 +0,0 @@ -#pragma once - -#include "helix.h" - -#ifdef USE_I2C -#include <stddef.h> -#ifdef __AVR__ - #include <avr/io.h> - #include <avr/interrupt.h> -#endif -#endif - -#if MATRIX_ROWS == 6 // HELIX_ROWS == 3 - #ifndef FLIP_HALF - // Standard Keymap - // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) - #define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25 \ - ) { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { R05, R04, R03, R02, R01, R00 }, \ - { R15, R14, R13, R12, R11, R10 }, \ - { R25, R24, R23, R22, R21, R20 } \ - } - #else - // Keymap with right side flipped - // (TRRS jack on both halves are to the right) - #define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25 \ - ) { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 } \ - } - #endif -#elif MATRIX_ROWS == 8 // HELIX_ROWS == 4 - #ifndef FLIP_HALF - // Standard Keymap - // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) - #define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ - ) { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { R05, R04, R03, R02, R01, R00 }, \ - { R15, R14, R13, R12, R11, R10 }, \ - { R25, R24, R23, R22, R21, R20 }, \ - { R35, R34, R33, R32, R31, R30 } \ - } - #else - // Keymap with right side flipped - // (TRRS jack on both halves are to the right) - #define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ - ) { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 } \ - } - #endif -#elif MATRIX_ROWS == 10 // HELIX_ROWS == 5 - #ifndef FLIP_HALF - // Standard Keymap - // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ -) { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { L40, L41, L42, L43, L44, L45 }, \ - { R05, R04, R03, R02, R01, R00 }, \ - { R15, R14, R13, R12, R11, R10 }, \ - { R25, R24, R23, R22, R21, R20 }, \ - { R35, R34, R33, R32, R31, R30 }, \ - { R45, R44, R43, R42, R41, R40 } \ -} - #else - // Keymap with right side flipped - // (TRRS jack on both halves are to the right) - #define LAYOUT( \ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ - ) { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { L40, L41, L42, L43, L44, L45 }, \ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 }, \ - { R40, R41, R42, R43, R44, R45 } \ - } - #endif -#else - #error "expected HELIX_ROWS 3 or 4 or 5" -#endif diff --git a/keyboards/helix/rev1/rules.mk b/keyboards/helix/rev1/rules.mk deleted file mode 100644 index 1418f01786..0000000000 --- a/keyboards/helix/rev1/rules.mk +++ /dev/null @@ -1,11 +0,0 @@ -SRC += local_drivers/i2c.c -SRC += local_drivers/serial.c -SRC += local_drivers/ssd1306.c -KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - -CUSTOM_MATRIX = yes - -SRC += rev1/matrix.c -SRC += rev1/split_util.c - -BACKLIGHT_ENABLE = no diff --git a/keyboards/helix/rev1/serial_config.h b/keyboards/helix/rev1/serial_config.h deleted file mode 100644 index 32218f9bbe..0000000000 --- a/keyboards/helix/rev1/serial_config.h +++ /dev/null @@ -1,9 +0,0 @@ -/// #error rev1 serial config - -#ifndef SOFT_SERIAL_PIN -/* Soft Serial defines */ -#define SOFT_SERIAL_PIN D0 - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 0 -#endif diff --git a/keyboards/helix/rev1/split_util.c b/keyboards/helix/rev1/split_util.c deleted file mode 100644 index 5debd6e00b..0000000000 --- a/keyboards/helix/rev1/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include <avr/io.h> -#include <avr/wdt.h> -#include <avr/power.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include <avr/eeprom.h> -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#endif -#ifdef USE_MATRIX_I2C - i2c_master_init(); -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { -#ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1<<VBUS)); //checks state of VBUS -} - -void split_keyboard_setup(void) { - setup_handedness(); - - if (has_usb()) { - keyboard_master_setup(); - } else { - keyboard_slave_setup(); - } - sei(); -} - -void keyboard_slave_loop(void) { - matrix_init(); - - while (1) { - matrix_slave_scan(); - } -} - -// this code runs before the usb and keyboard is initialized -void matrix_setup(void) { - split_keyboard_setup(); - - if (!has_usb()) { - keyboard_slave_loop(); - } -} diff --git a/keyboards/helix/rev1/split_util.h b/keyboards/helix/rev1/split_util.h deleted file mode 100644 index 595a0659e1..0000000000 --- a/keyboards/helix/rev1/split_util.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SPLIT_KEYBOARD_UTIL_H -#define SPLIT_KEYBOARD_UTIL_H - -#include <stdbool.h> -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h index 041acee215..8c6210bae4 100644 --- a/keyboards/helix/rev2/config.h +++ b/keyboards/helix/rev2/config.h @@ -1,6 +1,7 @@ /* Copyright 2012 Jun Wako <wakojun@gmail.com> Copyright 2015 Jack Humbert +Copyright 2018 MakotoKurauchi This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 +#define SPLIT_LAYER_STATE_ENABLE +#define SPLIT_LED_STATE_ENABLE + /* Use I2C or Serial */ #define USE_SERIAL //#define USE_MATRIX_I2C @@ -41,12 +45,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // #define MASTER_RIGHT // #define EE_HANDS -// Helix keyboard OLED support -// see ./local_features.mk: OLED_SELECT=local -#ifdef OLED_LOCAL_ENABLE - #define SSD1306OLED -#endif - #define OLED_UPDATE_INTERVAL 50 /* Select rows configuration */ @@ -158,6 +156,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c index d5209d8537..c7c65acaea 100644 --- a/keyboards/helix/rev2/keymaps/default/keymap.c +++ b/keyboards/helix/rev2/keymaps/default/keymap.c @@ -15,14 +15,6 @@ */ #include QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -73,12 +65,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_QWERTY] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Colemak @@ -94,12 +86,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_COLEMAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_COLEMAK] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Dvorak @@ -115,12 +107,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_DVORAK] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LBRC, KC_RBRC, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_DVORAK] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LBRC, KC_RBRC, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -136,12 +128,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -157,12 +149,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -178,12 +170,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ + [_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD ) }; @@ -202,11 +194,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Colemak @@ -220,11 +212,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_COLEMAK] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Dvorak @@ -238,11 +230,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_DVORAK] = LAYOUT( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -256,11 +248,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -274,11 +266,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -292,11 +284,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT( \ - _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ + [_ADJUST] = LAYOUT( + _______, QK_BOOT, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD ) }; diff --git a/keyboards/helix/rev2/keymaps/default/oled_display.c b/keyboards/helix/rev2/keymaps/default/oled_display.c index 36a7cf0b10..ad5558869f 100644 --- a/keyboards/helix/rev2/keymaps/default/oled_display.c +++ b/keyboards/helix/rev2/keymaps/default/oled_display.c @@ -18,10 +18,6 @@ #include <string.h> #include QMK_KEYBOARD_H -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -35,10 +31,15 @@ enum layer_number { _ADJUST }; -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#if defined(SSD1306OLED) || defined(OLED_ENABLE) +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) -# if defined(OLED_ENABLE) +//OLED update loop +#ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (is_keyboard_master()) { return OLED_ROTATION_0; @@ -46,12 +47,120 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } } -# else -# define oled_write(data,flag) matrix_write(matrix, data) -# define oled_write_P(data,flag) matrix_write_P(matrix, data) + +static void render_rgbled_status(bool full) { +# ifdef RGBLIGHT_ENABLE + char buf[30]; + if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { + if (full) { + snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", + rgblight_get_mode(), + rgblight_get_hue()/RGBLIGHT_HUE_STEP, + rgblight_get_sat()/RGBLIGHT_SAT_STEP, + rgblight_get_val()/RGBLIGHT_VAL_STEP); + } else { + snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode()); + } + oled_write(buf, false); + } # endif +} + +static void render_layer_status(void) { + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[10]; + oled_write_P(PSTR("Layer: "), false); + switch (layer_state) { + case L_BASE: + oled_write_P(PSTR("Default"), false); + break; + case L_RAISE: + oled_write_P(PSTR("Raise"), false); + break; + case L_LOWER: + oled_write_P(PSTR("Lower"), false); + break; + case L_ADJUST: + case L_ADJUST_TRI: + oled_write_P(PSTR("Adjust"), false); + break; + default: + oled_write_P(PSTR("Undef-"), false); + snprintf(buf,sizeof(buf), "%ld", layer_state); + oled_write(buf, false); + } + oled_write_P(PSTR("\n"), false); +} + +void render_status(void) { + // Render to mode icon + static const char os_logo[][2][3] PROGMEM = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if (is_mac_mode()) { + oled_write_P(os_logo[0][0], false); + oled_write_P(PSTR("\n"), false); + oled_write_P(os_logo[0][1], false); + } else { + oled_write_P(os_logo[1][0], false); + oled_write_P(PSTR("\n"), false); + oled_write_P(os_logo[1][1], false); + } + + oled_write_P(PSTR(" "), false); + render_layer_status(); + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUMLOCK") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCLK") : PSTR(" "), false); + oled_advance_page(true); + render_rgbled_status(true); + oled_write_P(PSTR("\n"), false); +} + +bool oled_task_user(void) { + +# if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +# endif + + if (is_keyboard_master()) { + render_status(); + } else { + render_helix_logo(); + render_rgbled_status(false); + render_layer_status(); + } + return false; +} +#endif // end of OLED_ENABLE + +//SSD1306 OLED update loop +/* + The following code is left as a sample to help you transition from SSD1306OLED to OLED_ENABLE. + + * `matrix_write(matrix, data)` is replaced by `oled_write(data, false)`. + * `matrix_write_P(matrix, data)` is replaced by `oled_write_P(data, false)`. + * It is no longer necessary to call `iota_gfx_task()`. + * `matrix_update()` are no longer needed. + * `iota_gfx_task_user()` is no longer needed. Instead, `bool oled_task_user(void)` is provided. + + 以下のコードは、SSD1306OLED から OLED_ENABLE に移行する助けになるようにサンプルとして残してあります。 + + * `matrix_write(matrix, data)` は、`oled_write(data, false)` に書き換えます。 + * `matrix_write_P(matrix, data)` は、`oled_write_P(data, false)` に書き換えます。 + * `iota_gfx_task()` を呼び出す必要はなくなります。 + * `matrix_update()` は不要になります。 + * `iota_gfx_task_user()` は不要になります。代りに `bool oled_task_user(void)` を用意します。 + */ + +#ifdef SSD1306OLED +#include "ssd1306.h" +#define oled_write(data,flag) matrix_write(matrix, data) +#define oled_write_P(data,flag) matrix_write_P(matrix, data) -# ifdef SSD1306OLED void matrix_scan_user(void) { iota_gfx_task(); // this is what updates the display continuously } @@ -63,20 +172,8 @@ void matrix_update(struct CharacterMatrix *dest, dest->dirty = true; } } -# endif -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_LOWER (1<<_LOWER) -#define L_RAISE (1<<_RAISE) -#define L_ADJUST (1<<_ADJUST) -#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) - -# ifdef SSD1306OLED static void render_logo(struct CharacterMatrix *matrix) { -# else -static void render_logo(void) { -# endif static const char helix_logo[] PROGMEM ={ 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, @@ -86,11 +183,7 @@ static void render_logo(void) { oled_write_P(helix_logo, false); } -# ifdef SSD1306OLED static void render_rgbled_status(bool full, struct CharacterMatrix *matrix) { -# else -static void render_rgbled_status(bool full) { -# endif # ifdef RGBLIGHT_ENABLE char buf[30]; if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { @@ -108,11 +201,7 @@ static void render_rgbled_status(bool full) { # endif } -# ifdef SSD1306OLED static void render_layer_status(struct CharacterMatrix *matrix) { -# else -static void render_layer_status(void) { -# endif // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below char buf[10]; oled_write_P(PSTR("Layer: "), false); @@ -138,11 +227,7 @@ static void render_layer_status(void) { oled_write_P(PSTR("\n"), false); } -# ifdef SSD1306OLED void render_status(struct CharacterMatrix *matrix) { -# else -void render_status(void) { -# endif // Render to mode icon static const char os_logo[][2][3] PROGMEM = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; if (is_mac_mode()) { @@ -156,11 +241,7 @@ void render_status(void) { } oled_write_P(PSTR(" "), false); -# ifdef SSD1306OLED render_layer_status(matrix); -# else - render_layer_status(); -# endif // Host Keyboard LED Status led_t led_state = host_keyboard_led_state(); @@ -168,35 +249,28 @@ void render_status(void) { oled_write_P(led_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false); oled_write_P(led_state.scroll_lock ? PSTR("SCLK") : PSTR(" "), false); oled_write_P(PSTR("\n"), false); -# ifdef SSD1306OLED render_rgbled_status(true, matrix); -# else - render_rgbled_status(true); - oled_write_P(PSTR("\n"), false); -# endif } - -# ifdef SSD1306OLED -# if OLED_UPDATE_INTERVAL > 0 +# if OLED_UPDATE_INTERVAL > 0 uint16_t oled_update_timeout; -# endif +# endif void iota_gfx_task_user(void) { struct CharacterMatrix matrix; -# if DEBUG_TO_SCREEN +# if DEBUG_TO_SCREEN if (debug_enable) { return; } -# endif +# endif -#if OLED_UPDATE_INTERVAL > 0 +# if OLED_UPDATE_INTERVAL > 0 if (timer_elapsed(oled_update_timeout) < OLED_UPDATE_INTERVAL) { return; } oled_update_timeout = timer_read(); -#endif +# endif matrix_clear(&matrix); if (is_keyboard_master()) { render_status(&matrix); @@ -207,22 +281,5 @@ void iota_gfx_task_user(void) { } matrix_update(&display, &matrix); } -# else -void oled_task_user(void) { - -# if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -# endif - if (is_keyboard_master()) { - render_status(); - } else { - render_logo(); - render_rgbled_status(false); - render_layer_status(); - } -} -# endif -#endif +#endif // end of SSD1306OLED diff --git a/keyboards/helix/rev2/keymaps/default/rules.mk b/keyboards/helix/rev2/keymaps/default/rules.mk index c16f3e2b87..508c4ba40e 100644 --- a/keyboards/helix/rev2/keymaps/default/rules.mk +++ b/keyboards/helix/rev2/keymaps/default/rules.mk @@ -1,10 +1,5 @@ -# QMK Standard Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -# See TOP/keyboards/helix/rules.mk for a list of options that can be set. -# See TOP/docs/config_options.md for more information. -# +SPLIT_KEYBOARD = yes + LTO_ENABLE = yes # if firmware size over limit, try this option # Helix Spacific Build Options @@ -29,7 +24,3 @@ OLED_SELECT = core ifeq ($(strip $(OLED_ENABLE)), yes) SRC += oled_display.c endif - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c index 500a7bbf1a..207aebc423 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c @@ -56,7 +56,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { return is_keyboard_left() ? rotation : rotation ^ OLED_ROTATION_180; } -void oled_task_user(void) { +bool oled_task_user(void) { if (is_keyboard_left()) { render_mode_icon(!get_enable_kc_lang()); render_layer_state(); @@ -64,5 +64,6 @@ void oled_task_user(void) { } else { render_logo(); } + return false; } #endif // OLED_ENABLE diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/oled.h b/keyboards/helix/rev2/keymaps/edvorakjp/oled.h index 994dcb5f54..d0c5685283 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/oled.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/oled.h @@ -9,4 +9,4 @@ void render_layer_state(void); void render_logo(void); void render_mode_icon(bool is_windows); oled_rotation_t oled_init_user(oled_rotation_t rotation); -void oled_task_user(void); +bool oled_task_user(void); diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk index 59b7acad5b..6b2d147514 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk +++ b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk @@ -5,6 +5,7 @@ # See TOP/keyboards/helix/rules.mk for a list of options that can be set. # See TOP/docs/config_options.md for more information. # +SPLIT_KEYBOARD = yes LTO_ENABLE = no # if firmware size over limit, try this option TAP_DANCE_ENABLE = yes diff --git a/keyboards/helix/rev2/keymaps/five_rows/config.h b/keyboards/helix/rev2/keymaps/five_rows/config.h index e1c124f419..4aae9b5cac 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows/config.h @@ -1,26 +1,7 @@ -/* -This is the c configuration file for the keymap +// Copyright (c) 2022 Takeshi Ishii (mtei@github) +// SPDX-License-Identifier: GPL-2.0-or-later -Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2015 Jack Humbert -Copyright 2020 mtei - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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 CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #undef TAPPING_TERM #define TAPPING_TERM 300 @@ -35,50 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. # define OLED_UPDATE_INTERVAL 50 #endif -// place overrides here - -// If you need more program area, try select and reduce rgblight modes to use. - -#define DISABLE_SYNC_TIMER - -// Selection of RGBLIGHT MODE to use. -#undef RGBLIGHT_ANIMATIONS -#undef RGBLIGHT_EFFECT_BREATHING -#undef RGBLIGHT_EFFECT_RAINBOW_MOOD -#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL -#undef RGBLIGHT_EFFECT_SNAKE -#undef RGBLIGHT_EFFECT_KNIGHT -#undef RGBLIGHT_EFFECT_CHRISTMAS -#undef RGBLIGHT_EFFECT_STATIC_GRADIENT -#undef RGBLIGHT_EFFECT_RGB_TEST -#undef RGBLIGHT_EFFECT_ALTERNATING - -#if defined(LED_ANIMATIONS) -# if LED_ANIMATIONS_LEVEL > 1 - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - //#define RGBLIGHT_EFFECT_SNAKE - //#define RGBLIGHT_EFFECT_KNIGHT - #define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - //#define RGBLIGHT_EFFECT_RGB_TEST - //#define RGBLIGHT_EFFECT_ALTERNATING -# else - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - //#define RGBLIGHT_EFFECT_RAINBOW_SWIRL - //#define RGBLIGHT_EFFECT_SNAKE - //#define RGBLIGHT_EFFECT_KNIGHT - //#define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - //#define RGBLIGHT_EFFECT_RGB_TEST - //#define RGBLIGHT_EFFECT_ALTERNATING -# endif -#endif - -#endif /* CONFIG_USER_H */ - -#ifdef DEBUG_CONFIG -# include "debug_config.h" -#endif diff --git a/keyboards/helix/rev2/keymaps/five_rows/keymap.c b/keyboards/helix/rev2/keymaps/five_rows/keymap.c index 16eff49244..d992425de7 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows/keymap.c @@ -15,16 +15,55 @@ */ #include QMK_KEYBOARD_H -#include "util.h" -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" + +#include "key_blocks.h" +#include "layer_number_util.h" + +#ifdef ENABLE_COLEMAK +# define COLEMAK_Colemak (COLEMAK, " Colemak"), +#else +# define COLEMAK_Colemak #endif -#ifdef CONSOLE_ENABLE - #include <print.h> +#ifdef ENABLE_DVORAK +# define DVORAK_Dvorak (DVORAK, " Dvorak"), +#else +# define DVORAK_Dvorak +#endif +#ifdef ENABLE_EUCALYN +# define EUCALYN_Eucalyn (EUCALYN, " Eucalyn"), +#else +# define EUCALYN_Eucalyn +#endif + +#define LAYER_NAME_LIST \ + (QWERTY, " Qwerty"), \ + COLEMAK_Colemak \ + DVORAK_Dvorak \ + EUCALYN_Eucalyn \ + (KEYPAD, " Keypad"), \ + (AUX, ":AUX"), \ + (KAUX, ":00"), \ + (LOWER, ":Func"), \ + (RAISE, ":Extra"), \ + (PADFUNC, ":PadFunc"), \ + (ADJUST, ":Adjust") + +enum layer_number { + // _QWERTY, _COLEMAK, ... + MAP(BUILD_LAYER_ENUM_NUMBER, LAYER_NAME_LIST) +}; + +#ifdef OLED_ENABLE +// static const char QWERTY_name[] PROGMEM = " Qwerty"; ... +MAP(BUILD_LAYER_NAME_STR, LAYER_NAME_LIST) + +const char *layer_names[] = { + // [_QWERTY] = QWERTY_name, ... + MAP(BUILD_LAYER_NAME_TABLE, LAYER_NAME_LIST) +}; #endif -#include "layer_number.h" + +const size_t num_of_layer_names = GET_ITEM_COUNT(LAYER_NAME_LIST); extern keymap_config_t keymap_config; @@ -52,8 +91,6 @@ enum custom_keycodes { #define ____ _______ #define KC_ADJ MO(_ADJUST) -#define _1_____2_____3_____4_____5 KC_1, KC_2, KC_3, KC_4, KC_5 -#define _6_____7_____8_____9_____0 KC_6, KC_7, KC_8, KC_9, KC_0 #define LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS \ KC_LOWER, KC_LOWER, KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC) #define RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER \ @@ -64,12 +101,6 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty */ -#define Q_____W_____E_____R_____T KC_Q, KC_W, KC_E, KC_R, KC_T -#define Y_____U_____I_____O_____P KC_Y, KC_U, KC_I, KC_O, KC_P -#define A_____S_____D_____F_____G KC_A, KC_S, KC_D, KC_F, KC_G -#define H_____J_____K_____L____SCLN KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B -#define N_____M____COMM__DOT___SLSH KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | * |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----| @@ -91,12 +122,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* Colemak */ -#define Q_____W_____F_____P_____G KC_Q, KC_W, KC_F, KC_P, KC_G -#define J_____L_____U_____Y____SCLN KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define A_____R_____S_____T_____D KC_A, KC_R, KC_S, KC_T, KC_D -#define H_____N_____E_____I_____O KC_H, KC_N, KC_E, KC_I, KC_O -#define Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B -#define K_____M____COMM__DOT___SLSH KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | * |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----| @@ -109,6 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower| * `-----------------------------------------------------------------------------------' */ +#ifdef ENABLE_COLEMAK [_COLEMAK] = LAYOUT_wrapper( KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC, KC_TAB, Q_____W_____F_____P_____G, J_____L_____U_____Y____SCLN, KC_BSLS, @@ -116,14 +142,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, Z_____X_____C_____V_____B, GRV__QUOT, K_____M____COMM__DOT___SLSH, KC_RSFT, LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER ), +#endif /* Dvorak */ -#define QUOT_COMM___DOT____P_____Y KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define F_____G_____C_____R_____L KC_F, KC_G, KC_C, KC_R, KC_L -#define A_____O_____E_____U_____I KC_A, KC_O, KC_E, KC_U, KC_I -#define D_____H_____T_____N_____S KC_D, KC_H, KC_T, KC_N, KC_S -#define SCLN___Q_____J_____K_____X KC_SCLN, KC_Q, KC_J, KC_K, KC_X -#define B_____M_____W_____V_____Z KC_B, KC_M, KC_W, KC_V, KC_Z #define GRV__SLSH KC_GRV, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | @@ -137,6 +158,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower| * `-----------------------------------------------------------------------------------' */ +#ifdef ENABLE_DVORAK [_DVORAK] = LAYOUT_wrapper( KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC, KC_TAB, QUOT_COMM___DOT____P_____Y, F_____G_____C_____R_____L, KC_BSLS, @@ -144,14 +166,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, SCLN___Q_____J_____K_____X, GRV__SLSH, B_____M_____W_____V_____Z, KC_RSFT, LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER ), +#endif /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) */ -#define Q_____W___COMM___DOT__SCLN KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN -#define M_____R_____D_____Y_____P KC_M, KC_R, KC_D, KC_Y, KC_P -#define A_____O_____E_____I_____U KC_A, KC_O, KC_E, KC_I, KC_U -#define G_____T_____K_____S_____N KC_G, KC_T, KC_K, KC_S, KC_N -#define Z_____X_____C_____V_____F KC_Z, KC_X, KC_C, KC_V, KC_F -#define B_____H_____J_____L____SLSH KC_B, KC_H, KC_J, KC_L, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | * |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----| @@ -164,6 +181,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower| * `-----------------------------------------------------------------------------------' */ +#ifdef ENABLE_EUCALYN [_EUCALYN] = LAYOUT_wrapper( KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC, KC_TAB, Q_____W___COMM___DOT__SCLN, M_____R_____D_____Y_____P, KC_BSLS, @@ -171,6 +189,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, Z_____X_____C_____V_____F, GRV__QUOT, B_____H_____J_____L____SLSH, KC_RSFT, LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER ), +#endif /* Keypad */ #define KP_TAB__PSLS_PAST KC_TAB, KC_PSLS, KC_PAST @@ -254,8 +273,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* Lower */ -#define F1____F2____F3____F4____F5 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define F6____F7____F8____F9____F10 KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 #define XXXX__PAUS__SLCK___INS XXXX, KC_PAUS, KC_SLCK, KC_INS #define XXXX___INS__SLCK__PAUS__XXXX XXXX, KC_INS, KC_SLCK, KC_PAUS, XXXX #define ADJ___ADJ KC_ADJ, KC_ADJ @@ -391,21 +408,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; case COLEMAK: +#ifdef ENABLE_COLEMAK if (record->event.pressed) { update_base_layer(_COLEMAK); } +#endif return false; break; case DVORAK: +#ifdef ENABLE_DVORAK if (record->event.pressed) { update_base_layer(_DVORAK); } +#endif return false; break; case EUCALYN: +#ifdef ENABLE_EUCALYN if (record->event.pressed) { update_base_layer(_EUCALYN); } +#endif return false; break; case KEYPAD: @@ -455,7 +478,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } - -void matrix_init_user(void) { - INIT_HELIX_OLED(); /* define in layer_number.h */ -} diff --git a/keyboards/helix/rev2/keymaps/five_rows/layer_number.h b/keyboards/helix/rev2/keymaps/five_rows/layer_number.h deleted file mode 100644 index 1272feba4f..0000000000 --- a/keyboards/helix/rev2/keymaps/five_rows/layer_number.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -enum layer_number { - _QWERTY = 0, - _COLEMAK, - _DVORAK, - _EUCALYN, - _KEYPAD, - _AUX, - _KAUX, - _LOWER, - _RAISE, - _PADFUNC, - _ADJUST, -}; - -#if defined(SSD1306OLED) -extern void init_helix_oled(void); -# define INIT_HELIX_OLED() init_helix_oled(); -#else -# define INIT_HELIX_OLED() -#endif diff --git a/keyboards/helix/rev2/keymaps/five_rows/matrix_output_unselect_delay.c b/keyboards/helix/rev2/keymaps/five_rows/matrix_output_unselect_delay.c deleted file mode 100644 index a093afe0a4..0000000000 --- a/keyboards/helix/rev2/keymaps/five_rows/matrix_output_unselect_delay.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2021 mtei - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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 QMK_KEYBOARD_H - -void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { - /* If none of the keys are pressed, - * there is no need to wait for time for the next line. */ - if (key_pressed) { -# ifdef MATRIX_IO_DELAY -# if MATRIX_IO_DELAY > 0 - wait_us(MATRIX_IO_DELAY); -# endif -# else - wait_us(30); -# endif - } -} diff --git a/keyboards/helix/rev2/keymaps/five_rows/oled_display.c b/keyboards/helix/rev2/keymaps/five_rows/oled_display.c deleted file mode 100644 index fcbd81c9b6..0000000000 --- a/keyboards/helix/rev2/keymaps/five_rows/oled_display.c +++ /dev/null @@ -1,278 +0,0 @@ -/* Copyright 2020 mtei - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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 QMK_KEYBOARD_H -#include <stdio.h> -#ifdef CONSOLE_ENABLE - #include "print.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif -#include <string.h> -#include "layer_number.h" - -extern int current_default_layer; - -void init_helix_oled(void) { -#ifdef SSD1306OLED - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - iota_gfx_init(!has_usb()); // turns on the display -#endif -} - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#if defined(SSD1306OLED) || defined(OLED_ENABLE) - -# if defined(OLED_ENABLE) -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (is_keyboard_master()) { - return OLED_ROTATION_0; - } else { - return OLED_ROTATION_180; - } -} -# else -# define oled_write(data,flag) matrix_write(matrix, data) -# define oled_write_P(data,flag) matrix_write_P(matrix, data) -# endif - -# ifdef SSD1306OLED -void matrix_scan_user(void) { - iota_gfx_task(); // this is what updates the display continuously -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} -# endif - -static char *sprint_decimal(char *buf, int data) { - if (data > 9) { - buf = sprint_decimal(buf, data/10); - } - *buf++ = "0123456789"[data%10]; - *buf = '\0'; - return buf; -} - -static char *sprint_hex(char *buf, uint32_t data) { - if (data > 0xf) { - buf = sprint_hex(buf, data/0x10); - } - *buf++ = "0123456789abcdef"[data & 0xf]; - *buf = '\0'; - return buf; -} - -char *sprints(char *buf, char *src) { - while (*src) { - *buf++ = *src++; - } - *buf = '\0'; - return buf; -} - -char *sprintx(char *buf, char *leadstr, uint32_t data) { - buf = sprints(buf, leadstr); - buf = sprint_hex(buf, data); - return buf; -} - -char *sprintd(char *buf, char *leadstr, int data) { - buf = sprints(buf, leadstr); - buf = sprint_decimal(buf, data); - return buf; -} - -char *sprint2d(char *buf, char *leadstr, int data) { - buf = sprints(buf, leadstr); - if (data > 99) { - return sprint_decimal(buf, data); - } - if (data < 10) { - *buf++ = ' '; - } - return sprint_decimal(buf, data); -} - -# ifdef SSD1306OLED -static void render_logo(struct CharacterMatrix *matrix) { -# else -static void render_logo(void) { -# endif - - static const char helix_logo[] PROGMEM = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - oled_write_P(helix_logo, false); - char buf[30]; - char *bufp; -# ifdef RGBLIGHT_ENABLE - if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { - bufp = sprint2d(buf, " LED ", rgblight_get_mode()); -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(bufp, " scan:", get_matrix_scan_rate()); -# else - bufp = sprintd(bufp, ": ", rgblight_get_hue()/RGBLIGHT_HUE_STEP); - bufp = sprintd(bufp, ",", rgblight_get_sat()/RGBLIGHT_SAT_STEP); - bufp = sprintd(bufp, ",", rgblight_get_val()/RGBLIGHT_VAL_STEP); - bufp = sprints(bufp, " "); -# endif - oled_write(buf, false); -# ifndef SSD1306OLED - } else { -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(buf, " scan:", get_matrix_scan_rate()); - oled_write(buf, false); -# endif - oled_write_P( PSTR("\n"), false); -# endif - } -# else -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(buf, " scan:", get_matrix_scan_rate()); - bufp = sprints(bufp, " "); - oled_write(buf, false); -# endif -# endif -} - -static const char Qwerty_name[] PROGMEM = " Qwerty"; -static const char Colemak_name[] PROGMEM = " Colemak"; -static const char Dvorak_name[] PROGMEM = " Dvorak"; -static const char Eucalyn_name[] PROGMEM = " Eucalyn"; -static const char Keypad_name[] PROGMEM = " Keypad"; - -static const char AUX_name[] PROGMEM = ":AUX"; -static const char KAUX_name[] PROGMEM = ":00"; -static const char Padfunc_name[] PROGMEM = ":PadFunc"; -static const char Lower_name[] PROGMEM = ":Func"; -static const char Raise_name[] PROGMEM = ":Extra"; -static const char Adjust_name[] PROGMEM = ":Adjust"; - -static const char *layer_names[] = { - [_QWERTY] = Qwerty_name, - [_COLEMAK] = Colemak_name, - [_DVORAK] = Dvorak_name, - [_EUCALYN]= Eucalyn_name, - [_KEYPAD] = Keypad_name, - [_AUX] = AUX_name, - [_KAUX] = KAUX_name, - [_LOWER] = Lower_name, - [_RAISE] = Raise_name, - [_PADFUNC]= Padfunc_name, - [_ADJUST] = Adjust_name -}; - -# ifdef SSD1306OLED -void render_status(struct CharacterMatrix *matrix) { -# else -void render_status(void) { -# endif - - // Render to mode icon - static const char os_logo[][2][3] PROGMEM ={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - oled_write_P(os_logo[0][0], false); - oled_write_P(PSTR("\n"), false); - oled_write_P(os_logo[0][1], false); - } else { - oled_write_P(os_logo[1][0], false); - oled_write_P(PSTR("\n"), false); - oled_write_P(os_logo[1][1], false); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - int name_num; - uint32_t lstate; - oled_write_P(layer_names[current_default_layer], false); -# ifdef DEBUG_MATRIX_SCAN_RATE - char buf[16]; - sprintd(buf, " scan:", get_matrix_scan_rate()); - oled_write(buf, false); -# endif - oled_write_P(PSTR("\n"), false); - for (lstate = layer_state, name_num = 0; - lstate && name_num < sizeof(layer_names)/sizeof(char *); - lstate >>=1, name_num++) { - if ((lstate & 1) != 0) { - if (layer_names[name_num]) { - oled_write_P(layer_names[name_num], false); - } - } - } - oled_write_P(PSTR("\n"), false); - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_P(led_state.num_lock ? PSTR("NUMLOCK ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CAPS ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("SCLK ") : PSTR(" "), false); -} - -# ifdef SSD1306OLED -# if OLED_UPDATE_INTERVAL > 0 -uint16_t oled_update_timeout; -# endif - -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - -# if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -# endif - -#if OLED_UPDATE_INTERVAL > 0 - if (timer_elapsed(oled_update_timeout) < OLED_UPDATE_INTERVAL) { - return; - } - oled_update_timeout = timer_read(); -#endif - matrix_clear(&matrix); - if (is_keyboard_master()) { - render_status(&matrix); - } else { - render_logo(&matrix); - } - matrix_update(&display, &matrix); -} -# else -void oled_task_user(void) { - -# if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -# endif - - if(is_keyboard_master()){ - render_status(); - }else{ - render_logo(); - } -} -# endif - -#endif diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk index 0012f657ab..8f31c0bd06 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk @@ -1,10 +1,6 @@ -# QMK Standard Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -# See TOP/keyboards/helix/rules.mk for a list of options that can be set. -# See TOP/docs/config_options.md for more information. -# +USER_NAME := mtei +SPLIT_KEYBOARD = yes + CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration # CONSOLE_ENABLE and COMMAND_ENABLE @@ -24,89 +20,6 @@ HELIX_ROWS = 5 # Helix Rows is 4 or 5 # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +OLED_SELECT = core -CUSTOM_DELAY = yes - -ifneq ($(strip $(HELIX)),) - define KEYMAP_OPTION_PARSE - # parse 'dispoff', 'consloe', 'na', 'ani', 'mini-ani', 'scan-api', - $(if $(SHOW_PARCE),$(info parse -$1-)) #debug - ifeq ($(strip $1),dispoff) - OLED_ENABLE = no - LED_BACK_ENABLE = no - LED_UNDERGLOW_ENABLE = no - endif - ifneq ($(filter nooled no-oled,$(strip $1)),) - OLED_ENABLE = no - endif - ifeq ($(strip $1),oled) - OLED_ENABLE = yes - endif - ifneq ($(filter core-oled core_oled newoled new-oled olednew oled-new,$(strip $1)),) - OLED_ENABLE = yes - OLED_SELECT = core - endif - ifneq ($(filter local-oled local_oled oldoled old-oled oledold oled-old,$(strip $1)),) - OLED_ENABLE = yes - OLED_SELECT = local - endif - ifeq ($(strip $1),console) - CONSOLE_ENABLE = yes - endif - ifeq ($(strip $1),debug) - DEBUG_CONFIG = yes - endif - ifneq ($(filter nodebug no-debug no_debug,$(strip $1)),) - DEBUG_CONFIG = no - endif - ifneq ($(filter na no_ani no-ani,$(strip $1)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter mini-ani mini_ani,$(strip $1)),) - LED_ANIMATIONS = mini - endif - ifneq ($(filter ani animation,$(strip $1)),) - LED_ANIMATIONS = yes - endif - ifeq ($(strip $1),lto) - LTO_ENABLE = yes - endif - ifneq ($(filter nolto no-lto no_lto,$(strip $1)),) - LTO_ENABLE = no - endif - ifeq ($(strip $1),scan-api) - # use DEBUG_MATRIX_SCAN_RATE - # see docs/newbs_testing_debugging.md - DEBUG_MATRIX_SCAN_RATE_ENABLE = api - endif - endef # end of KEYMAP_OPTION_PARSE - - COMMA=, - $(eval $(foreach A_OPTION_NAME,$(subst $(COMMA), ,$(HELIX)), \ - $(call KEYMAP_OPTION_PARSE,$(A_OPTION_NAME)))) -endif - -ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DLED_ANIMATIONS_LEVEL=2 -endif - -ifeq ($(strip $(LED_ANIMATIONS)), mini) - OPT_DEFS += -DLED_ANIMATIONS_LEVEL=1 - LED_ANIMATIONS = yes -endif - -ifeq ($(strip $(DEBUG_CONFIG)), yes) - OPT_DEFS += -DDEBUG_CONFIG -endif - -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += oled_display.c -endif - -ifeq ($(strip $(CUSTOM_DELAY)),yes) - SRC += matrix_output_unselect_delay.c -endif - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) +SRC += oled_display.c diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c index a22a4b1663..23b45ef317 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c @@ -1,10 +1,7 @@ #include QMK_KEYBOARD_H -#include "keymap_jp.h" -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif +#include "keymap_japanese.h" +#include <stdio.h> +#include <string.h> #ifdef SSD1306OLED #include "ssd1306.h" #endif @@ -15,15 +12,6 @@ // * If you want to use the Kana key you can enable this comment out. However, the binary size may be over. * // #define KANA_ENABLE -extern keymap_config_t keymap_config; - -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - -extern uint8_t is_master; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -209,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #error "undefined keymaps" #endif -#ifdef SSD1306OLED +#if defined(SSD1306OLED) || defined(OLED_ENABLE) char keylog[24] = {}; const char code_to_name[60] = { ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', @@ -266,7 +254,7 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { #endif bool process_record_user(uint16_t keycode, keyrecord_t *record) { - #ifdef SSD1306OLED + #if defined(SSD1306OLED) || defined(OLED_ENABLE) if (record->event.pressed) { set_keylog(keycode, record); } @@ -279,7 +267,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { rgblight_mode(RGB_current_mode); rgblight_step(); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); } break; #endif @@ -312,7 +300,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { eeconfig_update_rgblight_default(); rgblight_enable(); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); } break; #endif @@ -325,7 +313,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void matrix_init_user(void) { #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED @@ -431,7 +419,7 @@ void iota_gfx_task_user(void) { #endif matrix_clear(&matrix); - if (is_master) { + if (is_keyboard_master()) { render_status(&matrix); } else { render_logo(&matrix); @@ -440,4 +428,104 @@ void iota_gfx_task_user(void) { matrix_update(&display, &matrix); } -#endif +#endif // end of SSD1306OLED + +//OLED update loop +#ifdef OLED_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) { + return OLED_ROTATION_0; + } else { + return OLED_ROTATION_180; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE _BASE +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) +#define L_LOW_E (1<<_LOW_E) +#define L_RAI_E (1<<_RAI_E) +#define L_ADJUST_TRIE (L_ADJUST|L_RAI_E|L_LOW_E) + +const char helix_logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + +static inline void render_logo(void) { + oled_write(helix_logo, false); +} + +const char mac_win_logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + +static inline void render_status(void) { + char buf[20]; + // Render to mode icon + if(keymap_config.swap_lalt_lgui==false){ + oled_write(mac_win_logo[0][0], false); + oled_write_P(PSTR("\n"), false); + oled_write(mac_win_logo[0][1], false); + } else { + oled_write(mac_win_logo[1][0], false); + oled_write_P(PSTR("\n"), false); + oled_write(mac_win_logo[1][1], false); + } + + #ifdef RGBLIGHT_ENABLE + snprintf(buf, sizeof(buf), " LED mode:%d", (short)RGB_current_mode); + oled_write(buf, false); + #endif + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + oled_write_P(PSTR("\nLayer: "), false); + switch (layer_state) { + case L_BASE: + oled_write_P(default_layer_state == (1UL<<_BAS_E) ? PSTR("BaseEx") : PSTR("Base"), false); + break; + case L_RAISE: + oled_write_P(PSTR("Raise"), false); + break; + case L_RAI_E: + oled_write_P(PSTR("RaiseEx"), false); + break; + case L_LOWER: + oled_write_P(PSTR("Lower"), false); + break; + case L_LOW_E: + oled_write_P(PSTR("LowerEx"), false); + break; + case L_ADJUST: + case L_ADJUST_TRI: + case L_ADJUST_TRIE: + oled_write_P(PSTR("Adjust"), false); + break; + default: + snprintf(buf, sizeof(buf), "%d", (short)layer_state); + oled_write(buf, false); + } + + oled_write(keylog, false); +} + +bool oled_task_user(void) { + +# if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +# endif + + if (is_keyboard_master()) { + render_status(); + } else { + render_logo(); + } + + return false; +} + +#endif // end of OLED_ENABLE diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk index d44382f86a..6300137fd6 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk @@ -1,11 +1,5 @@ -# QMK Standard Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -# See TOP/keyboards/helix/rules.mk for a list of options that can be set. -# See TOP/docs/config_options.md for more information. -# LTO_ENABLE = no # if firmware size over limit, try this option +SPLIT_KEYBOARD = yes # Helix Spacific Build Options # you can uncomment and edit follows 7 Variables @@ -18,6 +12,10 @@ HELIX_ROWS = 5 # Helix Rows is 4 or 5 # LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) +# OLED_ENABLE が yes のとき +# OLED_SELECT が core ならば QMK 標準の oled_dirver.c を使用します。 +# OLED_SELECT が core 以外ならば従来どおり helix/local_drivers/ssd1306.c を使用します。 +# If OLED_ENABLE is 'yes' +# If OLED_SELECT is 'core', use QMK standard oled_dirver.c. +# If OLED_SELECT is other than 'core', use helix/local_drivers/ssd1306.c. +OLED_SELECT = core diff --git a/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk b/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk index 462a83f6e7..dd0d2eba07 100644 --- a/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk +++ b/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk @@ -5,7 +5,8 @@ # See TOP/keyboards/helix/rules.mk for a list of options that can be set. # See TOP/docs/config_options.md for more information. # -LTO_ENABLE = no # if firmware size over limit, try this option +SPLIT_KEYBOARD = yes +LTO_ENABLE = yes # if firmware size over limit, try this option MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control # AUDIO_ENABLE = yes # Audio output on port C6 @@ -22,7 +23,3 @@ LED_ANIMATIONS = yes # LED animations LED_BACK_ENABLE = no LED_UNDERGLOW_ENABLE = yes - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/froggy/config.h b/keyboards/helix/rev2/keymaps/froggy/config.h index 517368ae94..fea362bcd6 100644 --- a/keyboards/helix/rev2/keymaps/froggy/config.h +++ b/keyboards/helix/rev2/keymaps/froggy/config.h @@ -26,6 +26,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */ #define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ +// the froggy keymap does not use the right hand side, so sync_timer is not needed +#define DISABLE_SYNC_TIMER +// For the same reason, the following are also not needed +#undef SPLIT_LAYER_STATE_ENABLE +#undef SPLIT_LED_STATE_ENABLE + // If you need more program area, try select and reduce rgblight modes to use. // Selection of RGBLIGHT MODE to use. diff --git a/keyboards/helix/rev2/keymaps/froggy/keymap.c b/keyboards/helix/rev2/keymaps/froggy/keymap.c index 15fe1afb0c..484a0a34b9 100644 --- a/keyboards/helix/rev2/keymaps/froggy/keymap.c +++ b/keyboards/helix/rev2/keymaps/froggy/keymap.c @@ -1,24 +1,31 @@ #include QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif +#include <string.h> -extern keymap_config_t keymap_config; +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; +#ifdef SSD1306OLED + #include "ssd1306.h" #endif -extern uint8_t is_master; +#define LAYOUT_half( \ + L00, L01, L02, L03, L04, L05, \ + L10, L11, L12, L13, L14, L15, \ + L20, L21, L22, L23, L24, L25, \ + L30, L31, L32, L33, L34, L35, L36, \ + L40, L41, L42, L43, L44, L45, L46 \ +) { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { _______, _______, _______, _______, _______, _______, KC_NO }, \ + { _______, _______, _______, _______, _______, _______, KC_NO }, \ + { _______, _______, _______, _______, _______, _______, KC_NO }, \ + { _______, _______, _______, _______, _______, _______, _______ }, \ + { _______, _______, _______, _______, _______, _______, _______ } \ +} #define DELAY_TIME 75 static uint16_t key_timer; @@ -68,108 +75,107 @@ enum macro_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base - * ,-----------------------------------------. ,-----------------------------------------. - * | C+z | ; | [ | ( | < | { | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | KANA | P | K | R | A | F | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | BS | D | T | H | E | O | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Y | S | N | I | U |Space | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Gui | Sym | Num | OPT | Ent | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | C+z | ; | [ | ( | < | { | + * |------+------+------+------+------+------| + * | KANA | P | K | R | A | F | + * |------+------+------+------+------+------| + * | BS | D | T | H | E | O | + * |------+------+------+------+------+------+------. + * | Shift| Y | S | N | I | U |Space | + * |------+------+------+------+------+------+------| + * | Ctrl | Alt | Gui | Sym | Num | OPT | Ent | + * `------------------------------------------------' */ - [_BASE] = LAYOUT( \ - LCTL(KC_Z), KC_SCLN, KC_LBRC, KC_LPRN, KC_LT, KC_LCBR, _______, _______, _______, _______, _______, _______, \ - KANA, KC_P, KC_K, KC_R, KC_A, KC_F, _______, _______, _______, _______, _______, _______, \ - KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, _______, _______, _______, _______, _______, _______, \ - OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, _______, _______, _______, _______, _______, _______, _______, \ - OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), MO(_SYM), MO(_NUM), OPT_TAP_SP, KC_ENT, _______, _______, _______, _______, _______, _______, _______ \ - ), + [_BASE] = LAYOUT_half( \ + LCTL(KC_Z), KC_SCLN, KC_LBRC, KC_LPRN, KC_LT, KC_LCBR, \ + KANA, KC_P, KC_K, KC_R, KC_A, KC_F, \ + KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, \ + OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, \ + OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), MO(_SYM), MO(_NUM), OPT_TAP_SP, KC_ENT ), /* Opt - * ,-----------------------------------------. ,-----------------------------------------. - * | Esc | : | ] | ) | > | } | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | EISU| J | M | B | ' | Tab | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | . | V | C | L | Z | Q | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | X | G | W | - | Del | Esc | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | , | DTOP | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | Esc | : | ] | ) | > | } | + * |------+------+------+------+------+------| + * | EISU| J | M | B | ' | Tab | + * |------+------+------+------+------+------| + * | . | V | C | L | Z | Q | + * |------+------+------+------+------+------+------. + * | | X | G | W | - | Del | Esc | + * |------+------+------+------+------+------+------| + * | | | | , | DTOP | | | + * `------------------------------------------------' */ - [_OPT] = LAYOUT( \ - KC_ESC, KC_COLN,KC_RBRC, KC_RPRN,KC_GT, KC_RCBR, _______, _______, _______, _______, _______, _______, \ - EISU, KC_J, KC_M, KC_B, KC_QUOT, KC_TAB, _______, _______, _______, _______, _______, _______, \ - KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, _______, _______, _______, _______, _______, _______, \ - _______, KC_X, KC_G, KC_W, KC_MINUS, KC_DEL, KC_ESC, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______,_______, KC_COMM,DESKTOP, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_OPT] = LAYOUT_half( \ + KC_ESC, KC_COLN,KC_RBRC, KC_RPRN,KC_GT, KC_RCBR, \ + EISU, KC_J, KC_M, KC_B, KC_QUOT, KC_TAB, \ + KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, \ + _______, KC_X, KC_G, KC_W, KC_MINUS, KC_DEL, KC_ESC, \ + _______, _______,_______, KC_COMM,DESKTOP, _______, _______ \ ), /* Func - * ,-----------------------------------------. ,-----------------------------------------. - * |RGBRST| Hue | | RST | Mac | Win | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RGB1 | VAL+ | F7 | F8 | F9 | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RGB2 | VAL- | F4 | F5 | F6 | F12 | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | RGB3 | F10 | F1 | F2 | F3 | F11 | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * |RGBOFF| | | | | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * |RGBRST| Hue | | RST | Mac | Win | + * |------+------+------+------+------+------| + * | RGB1 | VAL+ | F7 | F8 | F9 | | + * |------+------+------+------+------+------| + * | RGB2 | VAL- | F4 | F5 | F6 | F12 | + * |------+------+------+------+------+------+------. + * | RGB3 | F10 | F1 | F2 | F3 | F11 | | + * |------+------+------+------+------+------+------| + * |RGBOFF| | | | | | | + * `------------------------------------------------' */ - [_FUNC] = LAYOUT( \ - RGBRST,RGB_HUI, _______, RESET, MAC, WIN, _______, _______, _______, _______, _______, _______, \ - RGB1, RGB_VAI, KC_F7, KC_F8, KC_F9, _______, _______, _______, _______, _______, _______, _______, \ - RGB2, RGB_VAD, KC_F4, KC_F5, KC_F6, KC_F12, _______, _______, _______, _______, _______, _______, \ - RGB3, KC_F10, KC_F1, KC_F2, KC_F3, KC_F11, _______, _______, _______, _______, _______, _______, _______, _______, \ - RGBOFF,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_FUNC] = LAYOUT_half( \ + RGBRST,RGB_HUI, _______, RESET, MAC, WIN, \ + RGB1, RGB_VAI, KC_F7, KC_F8, KC_F9, _______, \ + RGB2, RGB_VAD, KC_F4, KC_F5, KC_F6, KC_F12, \ + RGB3, KC_F10, KC_F1, KC_F2, KC_F3, KC_F11, _______, \ + RGBOFF,_______, _______, _______, _______, _______, _______ \ ), /* Sym - * ,-----------------------------------------. ,-----------------------------------------. - * | Ins | GRV | | PU | PD | ^ | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | \ | # | = | ? | % | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | $ | upA | @ | ! | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | CL | <- | dwA | -> | _ | & | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | PS | | ~ | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | Ins | GRV | | PU | PD | ^ | + * |------+------+------+------+------+------| + * | | \ | # | = | ? | % | + * |------+------+------+------+------+------| + * | | $ | upA | @ | ! | | | + * |------+------+------+------+------+------+------. + * | CL | <- | dwA | -> | _ | & | | + * |------+------+------+------+------+------+------| + * | | | PS | | ~ | | | + * `------------------------------------------------' */ - [_SYM] = LAYOUT( \ - KC_INS, KC_GRV, _______, KC_PGUP, KC_PGDN, KC_CIRC, _______, _______, _______, _______, _______, _______, \ - _______, KC_BSLS, KC_HASH, KC_EQL, KC_QUES, KC_PERC, _______, _______, _______, _______, _______, _______, \ - _______, KC_DLR, KC_UP, KC_AT, KC_EXLM, KC_PIPE, _______, _______, _______, _______, _______, _______, \ - KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_UNDS, KC_AMPR, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_PSCR, _______, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_SYM] = LAYOUT_half( \ + KC_INS, KC_GRV, _______, KC_PGUP, KC_PGDN, KC_CIRC, \ + _______, KC_BSLS, KC_HASH, KC_EQL, KC_QUES, KC_PERC, \ + _______, KC_DLR, KC_UP, KC_AT, KC_EXLM, KC_PIPE, \ + KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_UNDS, KC_AMPR, _______, \ + _______, _______, KC_PSCR, _______, KC_TILD, _______, _______ \ ), /* Raise - * ,-----------------------------------------. ,-----------------------------------------. - * | | | Func | home | End | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | * | 7 | 8 | 9 | - | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | . | / | 4 | 5 | 6 | + | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | LN | 0 | 1 | 2 | 3 |C+S+F1| | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | , | | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | | | Func | home | End | | + * |------+------+------+------+------+------| + * | | * | 7 | 8 | 9 | - | + * |------+------+------+------+------+------| + * | . | / | 4 | 5 | 6 | + | + * |------+------+------+------+------+------+------. + * | LN | 0 | 1 | 2 | 3 |C+S+F1| | + * |------+------+------+------+------+------+------| + * | | | | , | | | | + * `------------------------------------------------' */ - [_NUM] = LAYOUT( \ - _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, _______, _______, _______, _______, _______, _______, \ - _______, KC_ASTR, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, _______, _______, _______, _______, \ - KC_PDOT, KC_SLSH, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, _______, _______, _______, _______, _______, \ - KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_PDOT, KC_COMM, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_NUM] = LAYOUT_half( \ + _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, \ + _______, KC_ASTR, KC_P7, KC_P8, KC_P9, KC_MINS, \ + KC_PDOT, KC_SLSH, KC_P4, KC_P5, KC_P6, KC_PLUS, \ + KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, \ + _______, _______, KC_PDOT, KC_COMM, _______, _______, _______ \ ) }; #else @@ -268,7 +274,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef RGBLIGHT_ENABLE col = record->event.key.col; row = record->event.key.row; - if (record->event.pressed && ((row < 5 && is_master) || (row >= 5 && !is_master))) { + if (record->event.pressed && ((row < 5 && is_keyboard_master()) || (row >= 5 && !is_keyboard_master()))) { int end = keybuf_end; keybufs[end].col = col; keybufs[end].row = row % 5; @@ -379,7 +385,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { eeconfig_update_rgblight_default(); rgblight_enable(); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); RGBAnimation = false; } #endif @@ -396,7 +402,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { RGBAnimation = true; rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); } #endif break; @@ -405,7 +411,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { RGBAnimation = true; rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 1); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); } #endif break; @@ -414,7 +420,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { RGBAnimation = true; rgblight_mode(RGBLIGHT_MODE_KNIGHT); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); } #endif break; @@ -447,7 +453,7 @@ void matrix_init_user(void) { startup_user(); #endif #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED @@ -733,10 +739,117 @@ void iota_gfx_task_user(void) { #endif matrix_clear(&matrix); - if(is_master){ + if (is_keyboard_master()) { render_status(&matrix); } matrix_update(&display, &matrix); } +#endif // end of SSD1306OLED + +//OLED update loop +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_0; +} + +// Render to OLED +void render_status(void) { + + // froggy logo + static char logo[4][1][17]= + { + { + {0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0} + }, + { + {0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0} + }, + { + {0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,0} + }, + { + {0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0} + } + }; + + static char indctr[8][2][4]= + { + // white icon + { + {0x60,0x61,0x62,0}, + {0x63,0x64,0} + }, + { + {0x80,0x81,0x82,0}, + {0x83,0x84,0} + }, + { + {0xa0,0xa1,0xa2,0}, + {0xa3,0xa4,0} + }, + { + {0xc0,0xc1,0xc2,0}, + {0xc3,0xc4,0} + }, + // Black icon + { + {0x75,0x76,0x77,0}, + {0x78,0x79,0} + }, + { + {0x95,0x96,0x97,0}, + {0x98,0x99,0} + }, + { + {0xb5,0xb6,0xb7,0}, + {0xb8,0xb9,0} + }, + { + {0xd5,0xd6,0xd7,0}, + {0xd8,0xd9,0} + }, + }; + + int rown = 0; + int rowf = 0; + int rowa = 0; + int rows = 0; + + //Set Indicator icon + if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 4; } else { rown = 0; } + if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowa = 4; } else { rowa = 0; } + if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) { rows = 4; } else { rows = 0; } + if (layer_state == L_FUNC) { rowf = 4; } + + oled_write(indctr[rown] [0], false); + oled_write(indctr[rowf] [1], false); + oled_write(logo [0] [0], false); + oled_write(indctr[rown+1][0], false); + oled_write(indctr[rowf+1][1], false); + oled_write(logo [1] [0], false); + oled_write(indctr[rowa+2][0], false); + oled_write(indctr[rows+2][1], false); + oled_write(logo [2] [0], false); + oled_write(indctr[rowa+3][0], false); + oled_write(indctr[rows+3][1], false); + oled_write(logo [3] [0], false); + +} + +bool oled_task_user(void) { + +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } #endif + + if (is_keyboard_master()) { + render_status(); + } + return false; +} + +#endif // end of OLED_ENABLE diff --git a/keyboards/helix/rev2/keymaps/froggy/rules.mk b/keyboards/helix/rev2/keymaps/froggy/rules.mk index 5a0fd9a2b1..044e29443c 100644 --- a/keyboards/helix/rev2/keymaps/froggy/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy/rules.mk @@ -6,6 +6,7 @@ # See TOP/docs/config_options.md for more information. # LTO_ENABLE = no # if firmware size over limit, try this option +SPLIT_KEYBOARD = yes # Helix Spacific Build Options # you can uncomment and edit follows 7 Variables @@ -18,6 +19,10 @@ LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) +# OLED_ENABLE が yes のとき +# OLED_SELECT が core ならば QMK 標準の oled_dirver.c を使用します。 +# OLED_SELECT が core 以外ならば従来どおり helix/local_drivers/ssd1306.c を使用します。 +# If OLED_ENABLE is 'yes' +# If OLED_SELECT is 'core', use QMK standard oled_dirver.c. +# If OLED_SELECT is other than 'core', use helix/local_drivers/ssd1306.c. +OLED_SELECT = core diff --git a/keyboards/helix/rev2/keymaps/froggy_106/config.h b/keyboards/helix/rev2/keymaps/froggy_106/config.h index 36c3f2a799..9affa1d296 100644 --- a/keyboards/helix/rev2/keymaps/froggy_106/config.h +++ b/keyboards/helix/rev2/keymaps/froggy_106/config.h @@ -25,6 +25,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */ #define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ +// the froggy keymap does not use the right hand side, so sync_timer is not needed +#define DISABLE_SYNC_TIMER +// For the same reason, the following are also not needed +#undef SPLIT_LAYER_STATE_ENABLE +#undef SPLIT_LED_STATE_ENABLE + // If you need more program area, try select and reduce rgblight modes to use. // Selection of RGBLIGHT MODE to use. diff --git a/keyboards/helix/rev2/keymaps/froggy_106/keymap.c b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c index 3a433e56fd..2e1464bedf 100644 --- a/keyboards/helix/rev2/keymaps/froggy_106/keymap.c +++ b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c @@ -1,11 +1,28 @@ #include QMK_KEYBOARD_H -#include "keymap_jp.h" +#include "keymap_japanese.h" #include <string.h> #ifdef SSD1306OLED #include "ssd1306.h" #endif -extern uint8_t is_master; +#define LAYOUT_half( \ + L00, L01, L02, L03, L04, L05, \ + L10, L11, L12, L13, L14, L15, \ + L20, L21, L22, L23, L24, L25, \ + L30, L31, L32, L33, L34, L35, L36, \ + L40, L41, L42, L43, L44, L45, L46 \ +) { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { _______, _______, _______, _______, _______, _______, KC_NO }, \ + { _______, _______, _______, _______, _______, _______, KC_NO }, \ + { _______, _______, _______, _______, _______, _______, KC_NO }, \ + { _______, _______, _______, _______, _______, _______, _______ }, \ + { _______, _______, _______, _______, _______, _______, _______ } \ +} #define DELAY_TIME 75 static uint16_t key_timer; @@ -83,136 +100,136 @@ enum macro_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base - * ,-----------------------------------------. ,-----------------------------------------. - * | C+z | ; | [ | ( | < | { | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | KANA | P | K | R | A | F | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | BS | D | T | H | E | O | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Y | S | N | I | U |Space | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Gui | Sym | Num | OPT | Ent | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | C+z | ; | [ | ( | < | { | + * |------+------+------+------+------+------| + * | KANA | P | K | R | A | F | + * |------+------+------+------+------+------| + * | BS | D | T | H | E | O | + * |------+------+------+------+------+------+------. + * | Shift| Y | S | N | I | U |Space | + * |------+------+------+------+------+------+------| + * | Ctrl | Alt | Gui | Sym | Num | OPT | Ent | + * `------------------------------------------------' */ - [_BASE] = LAYOUT( \ - LCTL(KC_Z), KC_SCLN, KC_LBRC, KC_LPRN, KC_LT, KC_LCBR, _______, _______, _______, _______, _______, _______, \ - KANA, KC_P, KC_K, KC_R, KC_A, KC_F, _______, _______, _______, _______, _______, _______, \ - KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, _______, _______, _______, _______, _______, _______, \ - OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, _______, _______, _______, _______, _______, _______, _______, \ - OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), L_SYM, L_NUM, OPT_TAP_SP, KC_ENT, _______, _______, _______, _______, _______, _______, _______ \ + [_BASE] = LAYOUT_half( \ + LCTL(KC_Z), KC_SCLN, KC_LBRC, KC_LPRN, KC_LT, KC_LCBR, \ + KANA, KC_P, KC_K, KC_R, KC_A, KC_F, \ + KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, \ + OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, \ + OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), L_SYM, L_NUM, OPT_TAP_SP, KC_ENT \ ), - [_BASE_106] = LAYOUT( \ - LCTL(KC_Z), JP_SCLN, JP_LBRC, JP_LPRN, JP_LABK, JP_LCBR, _______, _______, _______, _______, _______, _______, \ - KANA, KC_P, KC_K, KC_R, KC_A, KC_F, _______, _______, _______, _______, _______, _______, \ - KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, _______, _______, _______, _______, _______, _______, \ - OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, _______, _______, _______, _______, _______, _______, _______, \ - OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), L_SYM, L_NUM, OPT_TAP_SP, KC_ENT, _______, _______, _______, _______, _______, _______, _______ \ + [_BASE_106] = LAYOUT_half( \ + LCTL(KC_Z), JP_SCLN, JP_LBRC, JP_LPRN, JP_LABK, JP_LCBR, \ + KANA, KC_P, KC_K, KC_R, KC_A, KC_F, \ + KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, \ + OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, \ + OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), L_SYM, L_NUM, OPT_TAP_SP, KC_ENT \ ), /* Opt - * ,-----------------------------------------. ,-----------------------------------------. - * | Esc | : | ] | ) | > | } | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | EISU| J | M | B | ' | Tab | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | . | V | C | L | Z | Q | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | X | G | W | - | Del | Esc | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | , | DTOP | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | Esc | : | ] | ) | > | } | + * |------+------+------+------+------+------| + * | EISU| J | M | B | ' | Tab | + * |------+------+------+------+------+------| + * | . | V | C | L | Z | Q | + * |------+------+------+------+------+------+------. + * | | X | G | W | - | Del | Esc | + * |------+------+------+------+------+------+------| + * | | | | , | DTOP | | | + * `------------------------------------------------' */ - [_OPT] = LAYOUT( \ - KC_ESC, KC_COLN,KC_RBRC, KC_RPRN,KC_GT, KC_RCBR, _______, _______, _______, _______, _______, _______, \ - EISU, KC_J, KC_M, KC_B, KC_QUOT, KC_TAB, _______, _______, _______, _______, _______, _______, \ - KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, _______, _______, _______, _______, _______, _______, \ - _______, KC_X, KC_G, KC_W, KC_MINUS, KC_DEL, KC_ESC, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______,_______, KC_COMM,DESKTOP, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_OPT] = LAYOUT_half( \ + KC_ESC, KC_COLN,KC_RBRC, KC_RPRN,KC_GT, KC_RCBR, \ + EISU, KC_J, KC_M, KC_B, KC_QUOT, KC_TAB, \ + KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, \ + _______, KC_X, KC_G, KC_W, KC_MINUS, KC_DEL, KC_ESC, \ + _______, _______,_______, KC_COMM,DESKTOP, _______, _______ \ ), - [_OPT_106] = LAYOUT( \ - KC_ESC, JP_COLN,JP_RBRC, JP_RPRN,JP_RABK, JP_RCBR, _______, _______, _______, _______, _______, _______, \ - EISU, KC_J, KC_M, KC_B, JP_QUOT, KC_TAB, _______, _______, _______, _______, _______, _______, \ - KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, _______, _______, _______, _______, _______, _______, \ - _______, KC_X, KC_G, KC_W, JP_MINS, KC_DEL, KC_ESC, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______,_______, KC_COMM,DESKTOP, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_OPT_106] = LAYOUT_half( \ + KC_ESC, JP_COLN,JP_RBRC, JP_RPRN,JP_RABK, JP_RCBR, \ + EISU, KC_J, KC_M, KC_B, JP_QUOT, KC_TAB, \ + KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, \ + _______, KC_X, KC_G, KC_W, JP_MINS, KC_DEL, KC_ESC, \ + _______, _______,_______, KC_COMM,DESKTOP, _______, _______ \ ), /* Sym - * ,-----------------------------------------. ,-----------------------------------------. - * | Ins | GRV | | PU | PD | ^ | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | \ | # | = | ? | % | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | $ | upA | @ | ! | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | CL | <- | dwA | -> | _ | & | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | PS | | ~ | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | Ins | GRV | | PU | PD | ^ | + * |------+------+------+------+------+------| + * | | \ | # | = | ? | % | + * |------+------+------+------+------+------| + * | | $ | upA | @ | ! | | | + * |------+------+------+------+------+------+------. + * | CL | <- | dwA | -> | _ | & | | + * |------+------+------+------+------+------+------+ + * | | | PS | | ~ | | | + * `------------------------------------------------' */ - [_SYM] = LAYOUT( \ - KC_INS, KC_GRV, _______, KC_PGUP, KC_PGDN, KC_CIRC, _______, _______, _______, _______, _______, _______, \ - _______, KC_BSLS, KC_HASH, KC_EQL, KC_QUES, KC_PERC, _______, _______, _______, _______, _______, _______, \ - _______, KC_DLR, KC_UP, KC_AT, KC_EXLM, KC_PIPE, _______, _______, _______, _______, _______, _______, \ - KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_UNDS, KC_AMPR, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_PSCR, _______, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_SYM] = LAYOUT_half( \ + KC_INS, KC_GRV, _______, KC_PGUP, KC_PGDN, KC_CIRC, \ + _______, KC_BSLS, KC_HASH, KC_EQL, KC_QUES, KC_PERC, \ + _______, KC_DLR, KC_UP, KC_AT, KC_EXLM, KC_PIPE, \ + KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_UNDS, KC_AMPR, _______, \ + _______, _______, KC_PSCR, _______, KC_TILD, _______, _______ \ ), - [_SYM_106] = LAYOUT( \ - KC_INS, JP_GRV, _______, KC_PGUP, KC_PGDN, JP_CIRC, _______, _______, _______, _______, _______, _______, \ - _______, JP_BSLS, JP_HASH, JP_EQL, JP_QUES, JP_PERC, _______, _______, _______, _______, _______, _______, \ - _______, JP_DLR, KC_UP, JP_AT, JP_EXLM, JP_PIPE, _______, _______, _______, _______, _______, _______, \ - KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,JP_UNDS, JP_AMPR, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_PSCR, _______, JP_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_SYM_106] = LAYOUT_half( \ + KC_INS, JP_GRV, _______, KC_PGUP, KC_PGDN, JP_CIRC, \ + _______, JP_BSLS, JP_HASH, JP_EQL, JP_QUES, JP_PERC, \ + _______, JP_DLR, KC_UP, JP_AT, JP_EXLM, JP_PIPE, \ + KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,JP_UNDS, JP_AMPR, _______, \ + _______, _______, KC_PSCR, _______, JP_TILD, _______, _______ \ ), /* Raise - * ,-----------------------------------------. ,-----------------------------------------. - * | | | Func | home | End | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | * | 7 | 8 | 9 | - | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | . | / | 4 | 5 | 6 | + | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | LN | 0 | 1 | 2 | 3 |C+S+F1| | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | . | , | | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * | | | Func | home | End | | + * |------+------+------+------+------+------| + * | | * | 7 | 8 | 9 | - | + * |------+------+------+------+------+------| + * | . | / | 4 | 5 | 6 | + | + * |------+------+------+------+------+------+------. + * | LN | 0 | 1 | 2 | 3 |C+S+F1| | + * |------+------+------+------+------+------+------| + * | | | . | , | | | | + * `------------------------------------------------' */ - [_NUM] = LAYOUT( \ - _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, _______, _______, _______, _______, _______, _______, \ - _______, KC_ASTR, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, _______, _______, _______, _______, \ - KC_DOT, KC_SLSH, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, _______, _______, _______, _______, _______, \ - KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_PDOT, KC_COMM, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_NUM] = LAYOUT_half( \ + _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, \ + _______, KC_ASTR, KC_P7, KC_P8, KC_P9, KC_MINS, \ + KC_DOT, KC_SLSH, KC_P4, KC_P5, KC_P6, KC_PLUS, \ + KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, \ + _______, _______, KC_PDOT, KC_COMM, _______, _______, _______ \ ), - [_NUM_106] = LAYOUT( \ - _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, _______, _______, _______, _______, _______, _______, \ - _______, JP_ASTR, KC_P7, KC_P8, KC_P9, JP_MINS, _______, _______, _______, _______, _______, _______, \ - KC_DOT, JP_SLSH, KC_P4, KC_P5, KC_P6, JP_PLUS, _______, _______, _______, _______, _______, _______, \ - KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, KC_PDOT, JP_COMM, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_NUM_106] = LAYOUT_half( \ + _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, \ + _______, JP_ASTR, KC_P7, KC_P8, KC_P9, JP_MINS, \ + KC_DOT, JP_SLSH, KC_P4, KC_P5, KC_P6, JP_PLUS, \ + KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, \ + _______, _______, KC_PDOT, JP_COMM, _______, _______, _______ \ ), /* Func - * ,-----------------------------------------. ,-----------------------------------------. - * |RGBRST| Hue |To101 | RST | Mac | Win | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RGB1 | VAL+ | F7 | F8 | F9 |To106 | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | RGB2 | VAL- | F4 | F5 | F6 | F12 | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | RGB3 | F10 | F1 | F2 | F3 | F11 | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * |RGBOFF| | | | | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' + * ,-----------------------------------------. + * |RGBRST| Hue |To101 | RST | Mac | Win | + * |------+------+------+------+------+------| + * | RGB1 | VAL+ | F7 | F8 | F9 |To106 | + * |------+------+------+------+------+------| + * | RGB2 | VAL- | F4 | F5 | F6 | F12 | + * |------+------+------+------+------+------+------. + * | RGB3 | F10 | F1 | F2 | F3 | F11 | | + * |------+------+------+------+------+------+------| + * |RGBOFF| | | | | | | + * `------------------------------------------------' */ - [_FUNC] = LAYOUT( \ - RGBRST,RGB_HUI, TO_101, RESET, MAC, WIN, _______, _______, _______, _______, _______, _______, \ - RGB1, RGB_VAI, KC_F7, KC_F8, KC_F9, TO_106, _______, _______, _______, _______, _______, _______, \ - RGB2, RGB_VAD, KC_F4, KC_F5, KC_F6, KC_F12, _______, _______, _______, _______, _______, _______, \ - RGB3, KC_F10, KC_F1, KC_F2, KC_F3, KC_F11, _______, _______, _______, _______, _______, _______, _______, _______, \ - RGBOFF,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + [_FUNC] = LAYOUT_half( \ + RGBRST,RGB_HUI, TO_101, RESET, MAC, WIN, \ + RGB1, RGB_VAI, KC_F7, KC_F8, KC_F9, TO_106, \ + RGB2, RGB_VAD, KC_F4, KC_F5, KC_F6, KC_F12, \ + RGB3, KC_F10, KC_F1, KC_F2, KC_F3, KC_F11, _______, \ + RGBOFF,_______, _______, _______, _______, _______, _______ \ ) }; #else @@ -317,7 +334,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef RGBLIGHT_ENABLE col = record->event.key.col; row = record->event.key.row; - if (record->event.pressed && ((row < 5 && is_master) || (row >= 5 && !is_master))) { + if (record->event.pressed && ((row < 5 && is_keyboard_master()) || (row >= 5 && !is_keyboard_master()))) { int end = keybuf_end; keybufs[end].col = col; keybufs[end].row = row % 5; @@ -807,14 +824,139 @@ void iota_gfx_task_user(void) { #endif matrix_clear(&matrix); - if(is_master){ + if (is_keyboard_master()) { render_status(&matrix); } matrix_update(&display, &matrix); } +#endif // end of SSD1306OLED + +//OLED update loop +#ifdef OLED_ENABLE + +// Render to OLED +void render_status(void) { + + // froggy logo + static char logo[4][17]= + { + {0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0}, + {0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0}, + {0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,0}, + {0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0}, + }; + + static char modectl[4][2][4]= + { + { + {0x65,0x66,0x67,0}, //WIN + {0x85,0x86,0x87,0}, //WIN + }, + { + {0xa5,0xa6,0xa7,0}, //US(101) + {0xc5,0xc6,0xc7,0}, //US(101) + }, + { + {0xbd,0xbe,0xbf,0}, //MAC + {0xdd,0xde,0xdf,0}, //MAC + }, + { + {0xba,0xbb,0xbc,0}, //JP(106) + {0xda,0xdb,0xdc,0}, //JP(106) + }, + }; + + static char indctr[8][2][4]= + { + // white icon + { + {0x60,0x61,0x62,0}, //NUM + {0x63,0x64,0} //FUNC + }, + { + {0x80,0x81,0x82,0}, //NUM + {0x83,0x84,0} //FUNC + }, + { + {0xa0,0xa1,0xa2,0}, //CAPS + {0xa3,0xa4,0} //SCLK + }, + { + {0xc0,0xc1,0xc2,0}, //CAPS + {0xc3,0xc4,0} //SCLK + }, + // Black icon + { + {0x75,0x76,0x77,0}, //NUM + {0x78,0x79,0} //FUNC + }, + { + {0x95,0x96,0x97,0}, //NUM + {0x98,0x99,0} //FUNC + }, + { + {0xb5,0xb6,0xb7,0}, //CAPS + {0xb8,0xb9,0} //SCLK + }, + { + {0xd5,0xd6,0xd7,0}, //CAPS + {0xd8,0xd9,0} //SCLK + }, + }; + + int rown = 0; + int rowf = 0; + int rowa = 0; + int rows = 0; + int rowm = 0; + int rowj = 1; + + //Set Indicator icon + if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 4; } + if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowa = 4; } + if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) { rows = 4; } + if (IS_LAYER_ON(_FUNC)) { rowf = 4; } + + //Set Mode icon + if (IS_MODE_MAC()) { rowm = 2; } + if (IS_MODE_106()) { rowj = 3; } + + oled_write(indctr[rown] [0], false); + oled_write(indctr[rowf] [1], false); + oled_write(modectl[rowm] [0], false); + oled_write(logo[0], false); + oled_write(indctr[rown+1][0], false); + oled_write(indctr[rowf+1][1], false); + oled_write(modectl[rowm] [1], false); + oled_write(logo[1], false); + oled_write(indctr[rowa+2][0], false); + oled_write(indctr[rows+2][1], false); + oled_write(modectl[rowj] [0], false); + oled_write(logo[2], false); + oled_write(indctr[rowa+3][0], false); + oled_write(indctr[rows+3][1], false); + oled_write(modectl[rowj] [1], false); + oled_write(logo[3], false); + +} + +bool oled_task_user(void) { + +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } #endif + if (is_keyboard_master()) { + render_status(); + } + return false; +} + +#endif // end of OLED_ENABLE + // Local Variables: // mode: c++ // truncate-lines: t diff --git a/keyboards/helix/rev2/keymaps/froggy_106/rules.mk b/keyboards/helix/rev2/keymaps/froggy_106/rules.mk index 5a0fd9a2b1..ba6a1670ea 100644 --- a/keyboards/helix/rev2/keymaps/froggy_106/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy_106/rules.mk @@ -5,7 +5,8 @@ # See TOP/keyboards/helix/rules.mk for a list of options that can be set. # See TOP/docs/config_options.md for more information. # -LTO_ENABLE = no # if firmware size over limit, try this option +LTO_ENABLE = yes # if firmware size over limit, try this option +SPLIT_KEYBOARD = yes # Helix Spacific Build Options # you can uncomment and edit follows 7 Variables @@ -18,6 +19,10 @@ LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) +# OLED_ENABLE が yes のとき +# OLED_SELECT が core ならば QMK 標準の oled_dirver.c を使用します。 +# OLED_SELECT が core 以外ならば従来どおり helix/local_drivers/ssd1306.c を使用します。 +# If OLED_ENABLE is 'yes' +# If OLED_SELECT is 'core', use QMK standard oled_dirver.c. +# If OLED_SELECT is other than 'core', use helix/local_drivers/ssd1306.c. +OLED_SELECT = core diff --git a/keyboards/helix/rev2/keymaps/led_test/rules.mk b/keyboards/helix/rev2/keymaps/led_test/rules.mk index 8b590eee86..1dc12bb1cb 100644 --- a/keyboards/helix/rev2/keymaps/led_test/rules.mk +++ b/keyboards/helix/rev2/keymaps/led_test/rules.mk @@ -5,6 +5,8 @@ # See TOP/keyboards/helix/rules.mk for a list of options that can be set. # See TOP/docs/config_options.md for more information. # +SPLIT_KEYBOARD = yes + LTO_ENABLE = no # if firmware size over limit, try this option # Helix Spacific Build Options @@ -23,7 +25,3 @@ ifeq ($(strip $(OLED_ENABLE)), yes) SRC += oled_display.c endif SRC += led_test_init.c - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c index bd8796d064..d9102cb59f 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c +++ b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c @@ -1,24 +1,10 @@ #include QMK_KEYBOARD_H -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" -#endif -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include <stdio.h> +#include <string.h> #ifdef SSD1306OLED #include "ssd1306.h" #endif - -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - -extern uint8_t is_master; - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -415,7 +401,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { rgblight_mode(RGB_current_mode); rgblight_step(); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); } #endif return false; @@ -449,7 +435,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { eeconfig_update_rgblight_default(); rgblight_enable(); - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); } #endif break; @@ -462,7 +448,7 @@ void matrix_init_user(void) { startup_user(); #endif #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; + RGB_current_mode = rgblight_get_mode(); #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED @@ -533,15 +519,15 @@ static void render_logo(struct CharacterMatrix *matrix) { static void render_rgbled_status(bool full, struct CharacterMatrix *matrix) { #ifdef RGBLIGHT_ENABLE char buf[30]; - if (RGBLIGHT_MODES > 1 && rgblight_config.enable) { + if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { if (full) { snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", - rgblight_config.mode, - rgblight_config.hue/RGBLIGHT_HUE_STEP, - rgblight_config.sat/RGBLIGHT_SAT_STEP, - rgblight_config.val/RGBLIGHT_VAL_STEP); + rgblight_get_mode(), + rgblight_get_hue()/RGBLIGHT_HUE_STEP, + rgblight_get_sat()/RGBLIGHT_SAT_STEP, + rgblight_get_val()/RGBLIGHT_VAL_STEP); } else { - snprintf(buf, sizeof(buf), "[%2d] ",rgblight_config.mode); + snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode()); } matrix_write(matrix, buf); } @@ -613,9 +599,9 @@ void iota_gfx_task_user(void) { #endif matrix_clear(&matrix); - if(is_master){ + if (is_keyboard_master()) { render_status(&matrix); - }else{ + } else { render_logo(&matrix); render_rgbled_status(false, &matrix); render_layer_status(&matrix); @@ -623,4 +609,121 @@ void iota_gfx_task_user(void) { matrix_update(&display, &matrix); } -#endif +#endif // end of SSD1306OLED + +#ifdef OLED_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (is_keyboard_master()) { + return OLED_ROTATION_0; + } else { + return OLED_ROTATION_180; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +static void render_logo(void) { + + static const char helix_logo[] PROGMEM ={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + oled_write_P(helix_logo, false); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + +static void render_rgbled_status(bool full) { +# ifdef RGBLIGHT_ENABLE + char buf[30]; + if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { + if (full) { + snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", + rgblight_get_mode(), + rgblight_get_hue()/RGBLIGHT_HUE_STEP, + rgblight_get_sat()/RGBLIGHT_SAT_STEP, + rgblight_get_val()/RGBLIGHT_VAL_STEP); + } else { + snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode()); + } + oled_write(buf, false); + } +# endif +} + +static void render_layer_status(void) { + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[10]; + oled_write_P(PSTR("Layer: "), false); + switch (layer_state) { + case L_BASE: + oled_write_P(PSTR("Default"), false); + break; + case L_RAISE: + oled_write_P(PSTR("Raise"), false); + break; + case L_LOWER: + oled_write_P(PSTR("Lower"), false); + break; + case L_ADJUST: + case L_ADJUST_TRI: + oled_write_P(PSTR("Adjust"), false); + break; + default: + oled_write_P(PSTR("Undef-"), false); + snprintf(buf,sizeof(buf), "%ld", layer_state); + oled_write(buf, false); + } + oled_write_P(PSTR("\n"), false); +} + +void render_status(void) { + // Render to mode icon + static const char os_logo[][2][3] PROGMEM ={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if (keymap_config.swap_lalt_lgui==false) { + oled_write_P(os_logo[0][0], false); + oled_write_P(PSTR("\n"), false); + oled_write_P(os_logo[0][1], false); + } else { + oled_write_P(os_logo[1][0], false); + oled_write_P(PSTR("\n"), false); + oled_write_P(os_logo[1][1], false); + } + + oled_write_P(PSTR(" "), false); + render_layer_status(); + + // Host Keyboard LED Status + oled_write_P((host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? + PSTR("NUMLOCK") : PSTR(" "), false); + oled_write_P((host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? + PSTR("CAPS") : PSTR(" "), false); + oled_write_P((host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? + PSTR("SCLK") : PSTR(" "), false); + oled_write_P(PSTR("\n"), false); + render_rgbled_status(true); + oled_write_P(PSTR("\n"), false); +} + +bool oled_task_user(void) { +# if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +# endif + + if (is_keyboard_master()) { + render_status(); + } else { + render_logo(); + render_rgbled_status(false); + render_layer_status(); + } + return false; +} +#endif // end of OLED_ENABLE diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk index 83dcc9b3b8..bc5190c706 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk +++ b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk @@ -6,6 +6,7 @@ # See TOP/docs/config_options.md for more information. # LTO_ENABLE = no # if firmware size over limit, try this option +SPLIT_KEYBOARD = yes # Helix Spacific Build Options # you can uncomment and edit follows 7 Variables @@ -18,6 +19,10 @@ OLED_ENABLE = yes # OLED_ENABLE LED_ANIMATIONS = no # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) +# OLED_ENABLE が yes のとき +# OLED_SELECT が core ならば QMK 標準の oled_dirver.c を使用します。 +# OLED_SELECT が core 以外ならば従来どおり helix/local_drivers/ssd1306.c を使用します。 +# If OLED_ENABLE is 'yes' +# If OLED_SELECT is 'core', use QMK standard oled_dirver.c. +# If OLED_SELECT is other than 'core', use helix/local_drivers/ssd1306.c. +OLED_SELECT = core diff --git a/keyboards/helix/rev2/local_features.mk b/keyboards/helix/rev2/local_features.mk index 8c3ac9c3c1..34fd699a65 100644 --- a/keyboards/helix/rev2/local_features.mk +++ b/keyboards/helix/rev2/local_features.mk @@ -6,40 +6,24 @@ # KEYBOARD_LOCAL_FEATURES_MK := - -define HELIX_CUSTOMISE_MSG - $(info Helix Spacific Build Options) - $(info - OLED_ENABLE = $(OLED_ENABLE)) - $(info - OLED_SELECT = $(OLED_SELECT)) - $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) - $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) - $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) - $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) - $(info ) -endef - -define HELIX_HELP_MSG - $(info Helix keyboard convenient command line option) - $(info - make HELIX=<options> helix:<keymap>) - $(info - option= oled | core-oled | local-oled | no-oled ) - $(info - back | no-back | under | na | no-ani ) - $(info - ios | sc | split-common | scan | verbose) - $(info - eg.) - $(info - make HELIX=no-oled helix:<keymap>) - $(info - make HELIX=oled,no-back helix:<keymap>) - $(info - make HELIX=oled,under helix:<keymap>) - $(info - make HELIX=oled,back,na helix:<keymap>) - $(info - make HELIX=oled,back,ios helix:<keymap>) - $(info ) -endef - - ifneq ($(strip $(HELIX)),) +-include $(strip $(HELIX_TOP_DIR)/rev2/override_helix_options.mk) ## File dedicated to maintenance + +# Parse 'HELIX=xx,yy,zz' option +ifneq ($(strip $(HELIX)),) + # make HELIX=ios helix/pico:AKEYMAP + # make HELIX=no-ani helix/pico:AKEYMAP + # make HELIX=no-oled helix/pico:AKEYMAP + # make HELIX=ios,no-ani,no-oled helix/pico:AKEYMAP define HELIX_OPTION_PARSE - # parce 'oled' 'back' 'under' 'ios' etc. - $(if $(SHOW_PARCE),$(info parse .$1.)) #debug + # parce 'no-ani' 'ios' 'no-oled' + $(if $(SHOW_PARCE),$(info parse .$1.)) #debug + $(if $(HELIX_OVERRIDE_PARSE),$(call HELIX_OVERRIDE_PARSE,$1)) - ifeq ($(strip $1),help) - HELP=on + ifeq ($(strip $1),ios) + IOS_DEVICE_ENABLE = yes + endif + ifneq ($(filter na no_ani no-ani,$(strip $1)),) + LED_ANIMATIONS = no endif ifneq ($(filter nooled no-oled,$(strip $1)),) OLED_ENABLE = no @@ -47,81 +31,13 @@ endef ifeq ($(strip $1),oled) OLED_ENABLE = yes endif - ifneq ($(filter core-oled core_oled newoled new-oled olednew oled-new,$(strip $1)),) - OLED_ENABLE = yes - OLED_SELECT = core - endif - ifneq ($(filter local-oled local_oled oldoled old-oled oledold oled-old,$(strip $1)),) - OLED_ENABLE = yes - OLED_SELECT = local - endif - ifneq ($(filter noback no-back nounder no-under,$(strip $1)),) - LED_BACK_ENABLE = no - LED_UNDERGLOW_ENABLE = no - endif - ifeq ($(strip $1),back) - LED_BACK_ENABLE = yes - LED_UNDERGLOW_ENABLE = no - endif - ifeq ($(strip $1),under) - LED_BACK_ENABLE = no - LED_UNDERGLOW_ENABLE = yes - endif - ifneq ($(filter na no_ani no-ani,$(strip $1)),) - LED_ANIMATIONS = no - endif - ifeq ($(strip $1),ios) - IOS_DEVICE_ENABLE = yes - endif - ifneq ($(filter sc split-common split_common,$(strip $1)),) - SPLIT_KEYBOARD = yes - endif - ifneq ($(filter nosc no-sc no-split-common no-split_common,$(strip $1)),) - SPLIT_KEYBOARD = no - endif - ifeq ($(strip $1),scan) - # use DEBUG_MATRIX_SCAN_RATE - # see docs/newbs_testing_debugging.md - OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE - CONSOLE_ENABLE = yes - SHOW_VERBOSE_INFO = yes - endif - ifeq ($(strip $1),verbose) - SHOW_VERBOSE_INFO = yes - endif - ifeq ($(strip $1),lto) - LTO_ENABLE = yes - endif - ifneq ($(filter nolto no-lto no_lto,$(strip $1)),) - LTO_ENABLE = no - endif endef # end of HELIX_OPTION_PARSE COMMA=, $(eval $(foreach A_OPTION_NAME,$(subst $(COMMA), ,$(HELIX)), \ $(call HELIX_OPTION_PARSE,$(A_OPTION_NAME)))) - ifeq ($(strip $(HELP)),on) - $(eval $(call HELIX_HELP_MSG)) - $(error ) - endif SHOW_HELIX_OPTIONS = yes - endif - -ifneq ($(strip $(SPLIT_KEYBOARD)), yes) - SRC += local_drivers/serial.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - - # A workaround until #7089 is merged. - # serial.c must not be compiled with the -lto option. - # The current LIB_SRC has a side effect with the -fno-lto option, so use it. - LIB_SRC += local_drivers/serial.c - - CUSTOM_MATRIX = yes - - SRC += rev2/matrix.c - SRC += rev2/split_util.c - SRC += rev2/split_scomm.c endif ######## @@ -139,7 +55,6 @@ ifeq ($(strip $(LED_BACK_ENABLE)), yes) RGBLIGHT_ENABLE = yes OPT_DEFS += -DRGBLED_BACK ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) - $(eval $(call HELIX_CUSTOMISE_MSG)) $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') endif else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) @@ -155,48 +70,29 @@ ifeq ($(strip $(LED_ANIMATIONS)), yes) endif ifeq ($(strip $(OLED_ENABLE)), yes) - ifeq ($(strip $(OLED_SELECT)),core) - OLED_ENABLE = yes - OLED_DRIVER = SSD1306 - ifeq ($(strip $(LOCAL_GLCDFONT)), yes) - OPT_DEFS += -DOLED_FONT_H=\<helixfont.h\> - else - OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" - endif + OLED_DRIVER = SSD1306 + ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DOLED_FONT_H=\<helixfont.h\> else - ifeq ($(strip $(SPLIT_KEYBOARD)), yes) - $(info Helix/rev2: The following combinations are not supported.) - $(info - SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) # yes - $(info - OLED_ENABLE = $(OLED_ENABLE)) # yes - $(info - OLED_SELECT = $(OLED_SELECT)) # local - $(info Force : OLED_ENABLE = no) - $(info .) - OLED_ENABLE = no - endif - ifeq ($(strip $(OLED_ENABLE)), yes) - OLED_ENABLE = no # disable OLED in TOP/common_features.mk - OLED_LOCAL_ENABLE = yes - SRC += local_drivers/i2c.c - SRC += local_drivers/ssd1306.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - OPT_DEFS += -DOLED_LOCAL_ENABLE - ifeq ($(strip $(LOCAL_GLCDFONT)), yes) - OPT_DEFS += -DLOCAL_GLCDFONT - endif - endif + OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\" endif endif ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) - $(eval $(call HELIX_CUSTOMISE_MSG)) - ifneq ($(strip $(SHOW_VERBOSE_INFO)),) - $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) - $(info -- OLED_DRIVER = $(OLED_DRIVER)) - $(info -- OLED_LOCAL_ENABLE = $(OLED_LOCAL_ENABLE)) - $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) - $(info -- OPT_DEFS = $(OPT_DEFS)) - $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) - $(info -- LTO_ENABLE = $(LTO_ENABLE)) - $(info ) - endif + $(info Helix Spacific Build Options) + $(info - OLED_ENABLE = $(OLED_ENABLE)) + $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) + $(info ) + $(info QMK Build Options) + $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) + $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) + $(info -- OLED_DRIVER = $(OLED_DRIVER)) + $(info -- OLED_LOCAL_ENABLE = $(OLED_LOCAL_ENABLE)) + $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) + $(info -- OPT_DEFS = $(OPT_DEFS)) + $(info -- LTO_ENABLE = $(LTO_ENABLE)) + $(info ) endif diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c deleted file mode 100644 index 8eed7e58b7..0000000000 --- a/keyboards/helix/rev2/matrix.c +++ /dev/null @@ -1,356 +0,0 @@ -/* -Copyright 2012 Jun Wako <wakojun@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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/>. -*/ - -/* - * scan matrix - */ -#include <stdint.h> -#include <stdbool.h> -#include <string.h> -#include <avr/io.h> -#include <avr/wdt.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "quantum.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "split_scomm.h" -#endif - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -#define ERROR_DISCONNECT_COUNT 5 - -static uint8_t debouncing = DEBOUNCE; -static const int ROWS_PER_HAND = MATRIX_ROWS/2; -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); -static uint8_t matrix_master_scan(void); - - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - split_keyboard_setup(); - - // initialize row and col - unselect_rows(); - init_cols(); - - setPinOutput(B0); - setPinOutput(D5); - writePinHigh(B0); - writePinHigh(D5); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); -} - -uint8_t _matrix_scan(void) -{ - // Right hand is stored after the left in the matirx so, we need to offset it - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); - - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i+offset] != cols) { - matrix_debouncing[i+offset] = cols; - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - } - } - - return 1; -} - -#ifdef USE_MATRIX_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(int master_changed) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; -#ifdef SERIAL_USE_MULTI_TRANSACTION - int ret=serial_update_buffers(master_changed); -#else - int ret=serial_update_buffers(); -#endif - if (ret ) { - if(ret==2) writePinLow(B0); - return 1; - } - writePinHigh(B0); - memcpy(&matrix[slaveOffset], - (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - if (is_helix_master()) { - matrix_master_scan(); - }else{ - matrix_slave_scan(); - int offset = (isLeftHand) ? ROWS_PER_HAND : 0; - memcpy(&matrix[offset], - (void *)serial_master_buffer, sizeof(serial_master_buffer)); - matrix_scan_quantum(); - } - return 1; -} - - -uint8_t matrix_master_scan(void) { - - int ret = _matrix_scan(); - int mchanged = 1; - -#ifndef KEYBOARD_helix_rev1 - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_MATRIX_I2C -// for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ -// i2c_slave_buffer[i] = matrix[offset+i]; -// } -#else // USE_SERIAL - #ifdef SERIAL_USE_MULTI_TRANSACTION - mchanged = memcmp((void *)serial_master_buffer, - &matrix[offset], sizeof(serial_master_buffer)); - #endif - memcpy((void *)serial_master_buffer, - &matrix[offset], sizeof(serial_master_buffer)); -#endif -#endif - -#ifdef USE_MATRIX_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction(mchanged) ) { -#endif - // turn on the indicator led when halves are disconnected - writePinLow(D5); - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - writePinHigh(D5); - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_MATRIX_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - /* i2c_slave_buffer[i] = matrix[offset+i]; */ - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - #ifdef SERIAL_USE_MULTI_TRANSACTION - int change = 0; - #endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - #ifdef SERIAL_USE_MULTI_TRANSACTION - if( serial_slave_buffer[i] != matrix[offset+i] ) - change = 1; - #endif - serial_slave_buffer[i] = matrix[offset+i]; - } - #ifdef SERIAL_USE_MULTI_TRANSACTION - slave_buffer_change_count += change; - #endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<<col)); -} - -inline -matrix_row_t matrix_get_row(uint8_t row) -{ - return matrix[row]; -} - -void matrix_print(void) -{ - print("\nr/c 0123456789ABCDEF\n"); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - print_hex8(row); print(": "); - print_bin_reverse16(matrix_get_row(row)); - print("\n"); - } -} - -uint8_t matrix_key_count(void) -{ - uint8_t count = 0; - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - count += bitpop16(matrix[i]); - } - return count; -} - -static void init_cols(void) -{ - for(int x = 0; x < MATRIX_COLS; x++) { - _SFR_IO8((col_pins[x] >> 4) + 1) &= ~_BV(col_pins[x] & 0xF); - _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); - } -} - -static matrix_row_t read_cols(void) -{ - matrix_row_t result = 0; - for(int x = 0; x < MATRIX_COLS; x++) { - result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); - } - return result; -} - -static void unselect_rows(void) -{ - for(int x = 0; x < ROWS_PER_HAND; x++) { - _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); - _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); - } -} - -static void select_row(uint8_t row) -{ - _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); - _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); -} diff --git a/keyboards/helix/rev2/override_helix_options.mk-maintenance b/keyboards/helix/rev2/override_helix_options.mk-maintenance new file mode 100644 index 0000000000..56dee8ce78 --- /dev/null +++ b/keyboards/helix/rev2/override_helix_options.mk-maintenance @@ -0,0 +1,46 @@ +ifneq ($(strip $(HELIX)),) + $(info -------------------------) + $(info override_helix_options.mk) + $(info -------------------------) +endif + +define HELIX_OVERRIDE_PARSE + ifeq ($(strip $1),back) + LED_BACK_ENABLE = yes + LED_UNDERGLOW_ENABLE = no + endif + ifeq ($(strip $1),under) + LED_BACK_ENABLE = no + LED_UNDERGLOW_ENABLE = yes + endif + ifneq ($(filter led-off led_off noback no-back nounder no-under,$(strip $1)),) + LED_BACK_ENABLE = no + LED_UNDERGLOW_ENABLE = no + endif + ifneq ($(filter core-oled core_oled newoled new-oled olednew oled-new,$(strip $1)),) + OLED_ENABLE = yes + OLED_SELECT = core + endif + ifneq ($(filter local-oled local_oled oldoled old-oled oledold oled-old,$(strip $1)),) + OLED_ENABLE = yes + OLED_SELECT = local + endif + ifneq ($(filter sc split-common split_common,$(strip $1)),) + SPLIT_KEYBOARD = yes + endif + ifneq ($(filter nosc no-sc no-split-common no-split_common,$(strip $1)),) + SPLIT_KEYBOARD = no + endif + ifeq ($(strip $1),scan) + DEBUG_MATRIX_SCAN_RATE_ENABLE = yes + endif + ifeq ($(strip $1),scan-api) + DEBUG_MATRIX_SCAN_RATE_ENABLE = api + endif + ifeq ($(strip $1),lto) + LTO_ENABLE = yes + endif + ifneq ($(filter nolto no-lto no_lto,$(strip $1)),) + LTO_ENABLE = no + endif +endef # end of HELIX_OVERRIDE_PARSE diff --git a/keyboards/helix/rev2/post_rules.mk b/keyboards/helix/rev2/post_rules.mk new file mode 100644 index 0000000000..4c671d4515 --- /dev/null +++ b/keyboards/helix/rev2/post_rules.mk @@ -0,0 +1,3 @@ +ifneq ($(strip $(KEYBOARD_LOCAL_FEATURES_MK)),) + include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) +endif diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c index b92580f9f9..2bbe9a28e2 100644 --- a/keyboards/helix/rev2/rev2.c +++ b/keyboards/helix/rev2/rev2.c @@ -1,3 +1,18 @@ +/* Copyright 2018 MakotoKurauchi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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 "helix.h" // Each keymap.c should use is_keyboard_master() instead of 'is_master'. @@ -5,14 +20,6 @@ // for the old keymap.c. uint8_t is_master = false; -#ifdef SSD1306OLED -#include "ssd1306.h" - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_gfx(keycode,record) && process_record_user(keycode, record); -} -#endif - bool is_mac_mode(void) { // This is the opposite of the QMK standard, but we'll leave it for backwards compatibility. return keymap_config.swap_lalt_lgui == false; @@ -44,8 +51,26 @@ void keyboard_post_init_kb(void) { keyboard_post_init_user(); } -#if defined(SPLIT_KEYBOARD) && defined(SSD1306OLED) -void matrix_slave_scan_user(void) { - matrix_scan_user(); +#ifdef OLED_ENABLE +void render_helix_logo(void) { + static const char helix_logo[] PROGMEM ={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + oled_write_P(helix_logo, false); } -#endif + +bool oled_task_kb(void) { + if (oled_task_user()) { + /* keymap/user level oled_task_user() dose not exist */ + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUMLOCK") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCLK") : PSTR(" "), false); + oled_advance_page(true); + render_helix_logo(); + } + return false; +} +#endif /* end of OLED_ENABLE */ diff --git a/keyboards/helix/rev2/rev2.h b/keyboards/helix/rev2/rev2.h index 787b6c67bb..fccbaf1ac4 100644 --- a/keyboards/helix/rev2/rev2.h +++ b/keyboards/helix/rev2/rev2.h @@ -1,3 +1,18 @@ +/* Copyright 2018 MakotoKurauchi + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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/>. + */ #pragma once #include "helix.h" @@ -5,6 +20,10 @@ bool is_mac_mode(void); void set_mac_mode_kb(bool macmode); +#ifdef OLED_ENABLE +void render_helix_logo(void); +#endif + #ifndef SPLIT_KEYBOARD extern bool is_helix_master(void); #define is_keyboard_master() is_helix_master() diff --git a/keyboards/helix/rev2/rules.mk b/keyboards/helix/rev2/rules.mk index a31e9d9b22..dce8b9d3ea 100644 --- a/keyboards/helix/rev2/rules.mk +++ b/keyboards/helix/rev2/rules.mk @@ -1,5 +1,7 @@ KEYBOARD_LOCAL_FEATURES_MK := $(dir $(lastword $(MAKEFILE_LIST)))local_features.mk +SPLIT_KEYBOARD = yes + # Helix Spacific Build Options default values HELIX_ROWS = 5 # Helix Rows is 4 or 5 OLED_ENABLE = yes # OLED_ENABLE @@ -8,8 +10,3 @@ LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# If OLED_ENABLE is 'yes' -# If OLED_SELECT is 'core', use QMK standard oled_dirver.c. -# If OLED_SELECT is other than 'core', use helix/local_drivers/ssd1306.c. -OLED_SELECT = local diff --git a/keyboards/helix/rev2/serial_config_simpleapi.h b/keyboards/helix/rev2/serial_config_simpleapi.h index e2d22a41e7..0e1dd9e4ac 100644 --- a/keyboards/helix/rev2/serial_config_simpleapi.h +++ b/keyboards/helix/rev2/serial_config_simpleapi.h @@ -1,8 +1,5 @@ -#ifndef SERIAL_CONFIG_SIMPLEAPI_H -#define SERIAL_CONFIG_SIMPLEAPI_H +#pragma once #undef SERIAL_USE_MULTI_TRANSACTION #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 - -#endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/helix/rev2/split_scomm.c b/keyboards/helix/rev2/split_scomm.c deleted file mode 100644 index 378781b98c..0000000000 --- a/keyboards/helix/rev2/split_scomm.c +++ /dev/null @@ -1,92 +0,0 @@ -#ifdef USE_SERIAL -#ifdef SERIAL_USE_MULTI_TRANSACTION -/* --- USE flexible API (using multi-type transaction function) --- */ - -#include <stdbool.h> -#include <stdint.h> -#include <stddef.h> -#include "split_scomm.h" -#include "serial.h" -#ifdef CONSOLE_ENABLE - #include "print.h" -#endif - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; -uint8_t volatile status_com = 0; -uint8_t volatile status1 = 0; -uint8_t slave_buffer_change_count = 0; -uint8_t s_change_old = 0xff; -uint8_t s_change_new = 0xff; - -SSTD_t transactions[] = { -#define GET_SLAVE_STATUS 0 - /* master buffer not changed, only recive slave_buffer_change_count */ - { (uint8_t *)&status_com, - 0, NULL, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, - }, -#define PUT_MASTER_GET_SLAVE_STATUS 1 - /* master buffer changed need send, and recive slave_buffer_change_count */ - { (uint8_t *)&status_com, - sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, - sizeof(slave_buffer_change_count), &slave_buffer_change_count, - }, -#define GET_SLAVE_BUFFER 2 - /* recive serial_slave_buffer */ - { (uint8_t *)&status1, - 0, NULL, - sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer - } -}; - -void serial_master_init(void) -{ - soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); -} - -void serial_slave_init(void) -{ - soft_serial_target_init(transactions, TID_LIMIT(transactions)); -} - -// 0 => no error -// 1 => slave did not respond -// 2 => checksum error -int serial_update_buffers(int master_update) -{ - int status, smatstatus; - static int need_retry = 0; - - if( s_change_old != s_change_new ) { - smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); - if( smatstatus == TRANSACTION_END ) { - s_change_old = s_change_new; -#ifdef CONSOLE_ENABLE - uprintf("slave matrix = %b %b %b %b %b\n", - serial_slave_buffer[0], serial_slave_buffer[1], - serial_slave_buffer[2], serial_slave_buffer[3], - serial_slave_buffer[4] ); -#endif - } - } else { - // serial_slave_buffer dosen't change - smatstatus = TRANSACTION_END; // dummy status - } - - if( !master_update && !need_retry) { - status = soft_serial_transaction(GET_SLAVE_STATUS); - } else { - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); - } - if( status == TRANSACTION_END ) { - s_change_new = slave_buffer_change_count; - need_retry = 0; - } else { - need_retry = 1; - } - return smatstatus; -} - -#endif // SERIAL_USE_MULTI_TRANSACTION -#endif /* USE_SERIAL */ diff --git a/keyboards/helix/rev2/split_scomm.h b/keyboards/helix/rev2/split_scomm.h deleted file mode 100644 index 873d8939d8..0000000000 --- a/keyboards/helix/rev2/split_scomm.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef SPLIT_COMM_H -#define SPLIT_COMM_H - -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ -#include "serial.h" - -#else -/* --- USE flexible API (using multi-type transaction function) --- */ -// Buffers for master - slave communication -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 - -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -extern uint8_t slave_buffer_change_count; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(int master_changed); - -#endif - -#endif /* SPLIT_COMM_H */ diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c deleted file mode 100644 index ab40315487..0000000000 --- a/keyboards/helix/rev2/split_util.c +++ /dev/null @@ -1,109 +0,0 @@ -#include <avr/io.h> -#include <avr/wdt.h> -#include <avr/power.h> -#include <avr/interrupt.h> -#include <util/delay.h> -#include <avr/eeprom.h> -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "wait.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else -# include "split_scomm.h" -#endif - -#ifdef EE_HANDS -# include "eeconfig.h" -#endif - -#ifndef SPLIT_USB_TIMEOUT -# define SPLIT_USB_TIMEOUT 2000 -#endif - -#ifndef SPLIT_USB_TIMEOUT_POLL -# define SPLIT_USB_TIMEOUT_POLL 10 -#endif - -volatile bool isLeftHand = true; - -bool waitForUsb(void) { - for (uint8_t i = 0; i < (SPLIT_USB_TIMEOUT / SPLIT_USB_TIMEOUT_POLL); i++) { - // This will return true if a USB connection has been established - if (UDADDR & _BV(ADDEN)) { - return true; - } - wait_ms(SPLIT_USB_TIMEOUT_POLL); - } - - // Avoid NO_USB_STARTUP_CHECK - Disable USB as the previous checks seem to enable it somehow - (USBCON &= ~(_BV(USBE) | _BV(OTGPADE))); - - return false; -} - - -bool is_keyboard_left(void) { -#if defined(SPLIT_HAND_PIN) - // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand - setPinInput(SPLIT_HAND_PIN); - return readPin(SPLIT_HAND_PIN); -#elif defined(EE_HANDS) - return eeconfig_read_handedness(); -#elif defined(MASTER_RIGHT) - return !is_helix_master(); -#endif - - return is_helix_master(); -} - -bool is_helix_master(void) { - static enum { UNKNOWN, MASTER, SLAVE } usbstate = UNKNOWN; - - // only check once, as this is called often - if (usbstate == UNKNOWN) { -#if defined(SPLIT_USB_DETECT) - usbstate = waitForUsb() ? MASTER : SLAVE; -#elif defined(__AVR__) - USBCON |= (1 << OTGPADE); // enables VBUS pad - wait_us(5); - - usbstate = (USBSTA & (1 << VBUS)) ? MASTER : SLAVE; // checks state of VBUS -#else - usbstate = MASTER; -#endif - } - - return (usbstate == MASTER); -} - -static void keyboard_master_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_master_init(); -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -void split_keyboard_setup(void) { - isLeftHand = is_keyboard_left(); - - if (is_helix_master()) { - keyboard_master_setup(); - } else { - keyboard_slave_setup(); - } - sei(); -} diff --git a/keyboards/helix/rev2/split_util.h b/keyboards/helix/rev2/split_util.h deleted file mode 100644 index c0ecdb0974..0000000000 --- a/keyboards/helix/rev2/split_util.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SPLIT_KEYBOARD_UTIL_H -#define SPLIT_KEYBOARD_UTIL_H - -#include <stdbool.h> -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool is_helix_master(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/helix/rev3_4rows/config.h b/keyboards/helix/rev3_4rows/config.h index 218ef5e5cc..1c0ec4d36c 100644 --- a/keyboards/helix/rev3_4rows/config.h +++ b/keyboards/helix/rev3_4rows/config.h @@ -161,10 +161,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -/* disable these deprecated features by default */ -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - /* Bootmagic Lite key configuration */ // #define BOOTMAGIC_LITE_ROW 0 // #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/helix/rev3_4rows/keymaps/default/config.h b/keyboards/helix/rev3_4rows/keymaps/default/config.h deleted file mode 100644 index ba446182d2..0000000000 --- a/keyboards/helix/rev3_4rows/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2020 yushakobo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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/>. - */ - -#pragma once - -// place overrides here diff --git a/keyboards/helix/rev3_4rows/keymaps/default/keymap.c b/keyboards/helix/rev3_4rows/keymaps/default/keymap.c index 408e7125c6..d98362f194 100644 --- a/keyboards/helix/rev3_4rows/keymaps/default/keymap.c +++ b/keyboards/helix/rev3_4rows/keymaps/default/keymap.c @@ -48,11 +48,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -66,11 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -84,11 +84,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -102,11 +102,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, RGBRST, EEP_RST, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ + [_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, RGBRST, EEP_RST, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD ) }; diff --git a/keyboards/helix/rev3_4rows/keymaps/default/oled_display.c b/keyboards/helix/rev3_4rows/keymaps/default/oled_display.c index fb1a6f9f87..e951f627c8 100644 --- a/keyboards/helix/rev3_4rows/keymaps/default/oled_display.c +++ b/keyboards/helix/rev3_4rows/keymaps/default/oled_display.c @@ -101,12 +101,13 @@ static void render_rgbled_status(bool full) { #endif } -void oled_task_user(void) { +bool oled_task_user(void) { if(is_keyboard_master()){ render_status(); }else{ render_logo(); render_rgbled_status(true); } + return false; } #endif diff --git a/keyboards/helix/rev3_4rows/keymaps/via/config.h b/keyboards/helix/rev3_4rows/keymaps/via/config.h deleted file mode 100644 index ba446182d2..0000000000 --- a/keyboards/helix/rev3_4rows/keymaps/via/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2020 yushakobo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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/>. - */ - -#pragma once - -// place overrides here diff --git a/keyboards/helix/rev3_4rows/keymaps/via/keymap.c b/keyboards/helix/rev3_4rows/keymaps/via/keymap.c index 6cc9aedb03..5633594bf5 100644 --- a/keyboards/helix/rev3_4rows/keymaps/via/keymap.c +++ b/keyboards/helix/rev3_4rows/keymaps/via/keymap.c @@ -48,11 +48,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - MO(_ADJUST), KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + MO(_ADJUST), KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower @@ -66,11 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -84,11 +84,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -102,11 +102,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ + [_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD ) }; diff --git a/keyboards/helix/rev3_4rows/keymaps/via/oled_display.c b/keyboards/helix/rev3_4rows/keymaps/via/oled_display.c index fb1a6f9f87..e951f627c8 100644 --- a/keyboards/helix/rev3_4rows/keymaps/via/oled_display.c +++ b/keyboards/helix/rev3_4rows/keymaps/via/oled_display.c @@ -101,12 +101,13 @@ static void render_rgbled_status(bool full) { #endif } -void oled_task_user(void) { +bool oled_task_user(void) { if(is_keyboard_master()){ render_status(); }else{ render_logo(); render_rgbled_status(true); } + return false; } #endif diff --git a/keyboards/helix/rev3_4rows/rev3_4rows.c b/keyboards/helix/rev3_4rows/rev3_4rows.c index 963cc744e7..704f915510 100644 --- a/keyboards/helix/rev3_4rows/rev3_4rows.c +++ b/keyboards/helix/rev3_4rows/rev3_4rows.c @@ -83,8 +83,8 @@ char *sprint2d(char *buf, char *leadstr, int data) { return sprint_decimal(buf, data); } -__attribute__((weak)) -void oled_task_user(void) { +bool oled_task_kb(void) { + if (!oled_task_user()) { return false; } static const char PROGMEM helix_logo[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, @@ -109,5 +109,6 @@ void oled_task_user(void) { } else { oled_write_P(helix_logo, false); } + return false; } #endif diff --git a/keyboards/helix/rev3_5rows/config.h b/keyboards/helix/rev3_5rows/config.h index 79c7961ed9..c880e27c88 100644 --- a/keyboards/helix/rev3_5rows/config.h +++ b/keyboards/helix/rev3_5rows/config.h @@ -161,10 +161,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -/* disable these deprecated features by default */ -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - /* Bootmagic Lite key configuration */ // #define BOOTMAGIC_LITE_ROW 0 // #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/helix/rev3_5rows/keymaps/default/config.h b/keyboards/helix/rev3_5rows/keymaps/default/config.h deleted file mode 100644 index ba446182d2..0000000000 --- a/keyboards/helix/rev3_5rows/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2020 yushakobo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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/>. - */ - -#pragma once - -// place overrides here diff --git a/keyboards/helix/rev3_5rows/keymaps/default/keymap.c b/keyboards/helix/rev3_5rows/keymaps/default/keymap.c index 09132f75e1..7799708073 100644 --- a/keyboards/helix/rev3_5rows/keymaps/default/keymap.c +++ b/keyboards/helix/rev3_5rows/keymaps/default/keymap.c @@ -49,12 +49,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_QWERTY] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower * ,-----------------------------------------. ,-----------------------------------------. @@ -69,12 +69,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -90,12 +90,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -111,12 +111,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, RGBRST, EEP_RST, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ + [_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, RGBRST, EEP_RST, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD ) }; diff --git a/keyboards/helix/rev3_5rows/keymaps/default/oled_display.c b/keyboards/helix/rev3_5rows/keymaps/default/oled_display.c index fb1a6f9f87..e951f627c8 100644 --- a/keyboards/helix/rev3_5rows/keymaps/default/oled_display.c +++ b/keyboards/helix/rev3_5rows/keymaps/default/oled_display.c @@ -101,12 +101,13 @@ static void render_rgbled_status(bool full) { #endif } -void oled_task_user(void) { +bool oled_task_user(void) { if(is_keyboard_master()){ render_status(); }else{ render_logo(); render_rgbled_status(true); } + return false; } #endif diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h b/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h index e1c124f419..ab679d14b9 100644 --- a/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h +++ b/keyboards/helix/rev3_5rows/keymaps/five_rows/config.h @@ -1,26 +1,7 @@ -/* -This is the c configuration file for the keymap +// Copyright (c) 2022 Takeshi Ishii (mtei@github) +// SPDX-License-Identifier: GPL-2.0-or-later -Copyright 2012 Jun Wako <wakojun@gmail.com> -Copyright 2015 Jack Humbert -Copyright 2020 mtei - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -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 CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #undef TAPPING_TERM #define TAPPING_TERM 300 @@ -35,50 +16,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. # define OLED_UPDATE_INTERVAL 50 #endif -// place overrides here - -// If you need more program area, try select and reduce rgblight modes to use. - -#define DISABLE_SYNC_TIMER +#define PSEUDO_SPRINTF_DEFINED -// Selection of RGBLIGHT MODE to use. -#undef RGBLIGHT_ANIMATIONS -#undef RGBLIGHT_EFFECT_BREATHING -#undef RGBLIGHT_EFFECT_RAINBOW_MOOD -#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL -#undef RGBLIGHT_EFFECT_SNAKE -#undef RGBLIGHT_EFFECT_KNIGHT -#undef RGBLIGHT_EFFECT_CHRISTMAS -#undef RGBLIGHT_EFFECT_STATIC_GRADIENT -#undef RGBLIGHT_EFFECT_RGB_TEST -#undef RGBLIGHT_EFFECT_ALTERNATING - -#if defined(LED_ANIMATIONS) -# if LED_ANIMATIONS_LEVEL > 1 - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - //#define RGBLIGHT_EFFECT_SNAKE - //#define RGBLIGHT_EFFECT_KNIGHT - #define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - //#define RGBLIGHT_EFFECT_RGB_TEST - //#define RGBLIGHT_EFFECT_ALTERNATING -# else - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - //#define RGBLIGHT_EFFECT_RAINBOW_SWIRL - //#define RGBLIGHT_EFFECT_SNAKE - //#define RGBLIGHT_EFFECT_KNIGHT - //#define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - //#define RGBLIGHT_EFFECT_RGB_TEST - //#define RGBLIGHT_EFFECT_ALTERNATING -# endif -#endif - -#endif /* CONFIG_USER_H */ - -#ifdef DEBUG_CONFIG -# include "debug_config.h" -#endif diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/keymap.c b/keyboards/helix/rev3_5rows/keymaps/five_rows/keymap.c index 16eff49244..d992425de7 100644 --- a/keyboards/helix/rev3_5rows/keymaps/five_rows/keymap.c +++ b/keyboards/helix/rev3_5rows/keymaps/five_rows/keymap.c @@ -15,16 +15,55 @@ */ #include QMK_KEYBOARD_H -#include "util.h" -#include "bootloader.h" -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" + +#include "key_blocks.h" +#include "layer_number_util.h" + +#ifdef ENABLE_COLEMAK +# define COLEMAK_Colemak (COLEMAK, " Colemak"), +#else +# define COLEMAK_Colemak #endif -#ifdef CONSOLE_ENABLE - #include <print.h> +#ifdef ENABLE_DVORAK +# define DVORAK_Dvorak (DVORAK, " Dvorak"), +#else +# define DVORAK_Dvorak +#endif +#ifdef ENABLE_EUCALYN +# define EUCALYN_Eucalyn (EUCALYN, " Eucalyn"), +#else +# define EUCALYN_Eucalyn +#endif + +#define LAYER_NAME_LIST \ + (QWERTY, " Qwerty"), \ + COLEMAK_Colemak \ + DVORAK_Dvorak \ + EUCALYN_Eucalyn \ + (KEYPAD, " Keypad"), \ + (AUX, ":AUX"), \ + (KAUX, ":00"), \ + (LOWER, ":Func"), \ + (RAISE, ":Extra"), \ + (PADFUNC, ":PadFunc"), \ + (ADJUST, ":Adjust") + +enum layer_number { + // _QWERTY, _COLEMAK, ... + MAP(BUILD_LAYER_ENUM_NUMBER, LAYER_NAME_LIST) +}; + +#ifdef OLED_ENABLE +// static const char QWERTY_name[] PROGMEM = " Qwerty"; ... +MAP(BUILD_LAYER_NAME_STR, LAYER_NAME_LIST) + +const char *layer_names[] = { + // [_QWERTY] = QWERTY_name, ... + MAP(BUILD_LAYER_NAME_TABLE, LAYER_NAME_LIST) +}; #endif -#include "layer_number.h" + +const size_t num_of_layer_names = GET_ITEM_COUNT(LAYER_NAME_LIST); extern keymap_config_t keymap_config; @@ -52,8 +91,6 @@ enum custom_keycodes { #define ____ _______ #define KC_ADJ MO(_ADJUST) -#define _1_____2_____3_____4_____5 KC_1, KC_2, KC_3, KC_4, KC_5 -#define _6_____7_____8_____9_____0 KC_6, KC_7, KC_8, KC_9, KC_0 #define LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS \ KC_LOWER, KC_LOWER, KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC) #define RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER \ @@ -64,12 +101,6 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty */ -#define Q_____W_____E_____R_____T KC_Q, KC_W, KC_E, KC_R, KC_T -#define Y_____U_____I_____O_____P KC_Y, KC_U, KC_I, KC_O, KC_P -#define A_____S_____D_____F_____G KC_A, KC_S, KC_D, KC_F, KC_G -#define H_____J_____K_____L____SCLN KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B -#define N_____M____COMM__DOT___SLSH KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | * |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----| @@ -91,12 +122,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* Colemak */ -#define Q_____W_____F_____P_____G KC_Q, KC_W, KC_F, KC_P, KC_G -#define J_____L_____U_____Y____SCLN KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define A_____R_____S_____T_____D KC_A, KC_R, KC_S, KC_T, KC_D -#define H_____N_____E_____I_____O KC_H, KC_N, KC_E, KC_I, KC_O -#define Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B -#define K_____M____COMM__DOT___SLSH KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | * |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----| @@ -109,6 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower| * `-----------------------------------------------------------------------------------' */ +#ifdef ENABLE_COLEMAK [_COLEMAK] = LAYOUT_wrapper( KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC, KC_TAB, Q_____W_____F_____P_____G, J_____L_____U_____Y____SCLN, KC_BSLS, @@ -116,14 +142,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, Z_____X_____C_____V_____B, GRV__QUOT, K_____M____COMM__DOT___SLSH, KC_RSFT, LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER ), +#endif /* Dvorak */ -#define QUOT_COMM___DOT____P_____Y KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define F_____G_____C_____R_____L KC_F, KC_G, KC_C, KC_R, KC_L -#define A_____O_____E_____U_____I KC_A, KC_O, KC_E, KC_U, KC_I -#define D_____H_____T_____N_____S KC_D, KC_H, KC_T, KC_N, KC_S -#define SCLN___Q_____J_____K_____X KC_SCLN, KC_Q, KC_J, KC_K, KC_X -#define B_____M_____W_____V_____Z KC_B, KC_M, KC_W, KC_V, KC_Z #define GRV__SLSH KC_GRV, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | @@ -137,6 +158,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower| * `-----------------------------------------------------------------------------------' */ +#ifdef ENABLE_DVORAK [_DVORAK] = LAYOUT_wrapper( KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC, KC_TAB, QUOT_COMM___DOT____P_____Y, F_____G_____C_____R_____L, KC_BSLS, @@ -144,14 +166,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, SCLN___Q_____J_____K_____X, GRV__SLSH, B_____M_____W_____V_____Z, KC_RSFT, LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER ), +#endif /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) */ -#define Q_____W___COMM___DOT__SCLN KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN -#define M_____R_____D_____Y_____P KC_M, KC_R, KC_D, KC_Y, KC_P -#define A_____O_____E_____I_____U KC_A, KC_O, KC_E, KC_I, KC_U -#define G_____T_____K_____S_____N KC_G, KC_T, KC_K, KC_S, KC_N -#define Z_____X_____C_____V_____F KC_Z, KC_X, KC_C, KC_V, KC_F -#define B_____H_____J_____L____SLSH KC_B, KC_H, KC_J, KC_L, KC_SLSH /* ,-----------------------------------. ,-----------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS | * |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----| @@ -164,6 +181,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower| * `-----------------------------------------------------------------------------------' */ +#ifdef ENABLE_EUCALYN [_EUCALYN] = LAYOUT_wrapper( KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC, KC_TAB, Q_____W___COMM___DOT__SCLN, M_____R_____D_____Y_____P, KC_BSLS, @@ -171,6 +189,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, Z_____X_____C_____V_____F, GRV__QUOT, B_____H_____J_____L____SLSH, KC_RSFT, LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER ), +#endif /* Keypad */ #define KP_TAB__PSLS_PAST KC_TAB, KC_PSLS, KC_PAST @@ -254,8 +273,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* Lower */ -#define F1____F2____F3____F4____F5 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define F6____F7____F8____F9____F10 KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 #define XXXX__PAUS__SLCK___INS XXXX, KC_PAUS, KC_SLCK, KC_INS #define XXXX___INS__SLCK__PAUS__XXXX XXXX, KC_INS, KC_SLCK, KC_PAUS, XXXX #define ADJ___ADJ KC_ADJ, KC_ADJ @@ -391,21 +408,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; case COLEMAK: +#ifdef ENABLE_COLEMAK if (record->event.pressed) { update_base_layer(_COLEMAK); } +#endif return false; break; case DVORAK: +#ifdef ENABLE_DVORAK if (record->event.pressed) { update_base_layer(_DVORAK); } +#endif return false; break; case EUCALYN: +#ifdef ENABLE_EUCALYN if (record->event.pressed) { update_base_layer(_EUCALYN); } +#endif return false; break; case KEYPAD: @@ -455,7 +478,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } - -void matrix_init_user(void) { - INIT_HELIX_OLED(); /* define in layer_number.h */ -} diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/layer_number.h b/keyboards/helix/rev3_5rows/keymaps/five_rows/layer_number.h deleted file mode 100644 index 1272feba4f..0000000000 --- a/keyboards/helix/rev3_5rows/keymaps/five_rows/layer_number.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -enum layer_number { - _QWERTY = 0, - _COLEMAK, - _DVORAK, - _EUCALYN, - _KEYPAD, - _AUX, - _KAUX, - _LOWER, - _RAISE, - _PADFUNC, - _ADJUST, -}; - -#if defined(SSD1306OLED) -extern void init_helix_oled(void); -# define INIT_HELIX_OLED() init_helix_oled(); -#else -# define INIT_HELIX_OLED() -#endif diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/matrix_output_unselect_delay.c b/keyboards/helix/rev3_5rows/keymaps/five_rows/matrix_output_unselect_delay.c deleted file mode 100644 index a093afe0a4..0000000000 --- a/keyboards/helix/rev3_5rows/keymaps/five_rows/matrix_output_unselect_delay.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2021 mtei - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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 QMK_KEYBOARD_H - -void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { - /* If none of the keys are pressed, - * there is no need to wait for time for the next line. */ - if (key_pressed) { -# ifdef MATRIX_IO_DELAY -# if MATRIX_IO_DELAY > 0 - wait_us(MATRIX_IO_DELAY); -# endif -# else - wait_us(30); -# endif - } -} diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c b/keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c deleted file mode 100644 index e8ba0d720f..0000000000 --- a/keyboards/helix/rev3_5rows/keymaps/five_rows/oled_display.c +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright 2020 mtei - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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 QMK_KEYBOARD_H -#include <stdio.h> -#ifdef CONSOLE_ENABLE - #include "print.h" -#endif -#ifdef SSD1306OLED - #include "ssd1306.h" -#endif -#include <string.h> -#include "layer_number.h" - -char *sprints(char *buf, char *src); -char *sprintd(char *buf, char *leadstr, int data); -char *sprint2d(char *buf, char *leadstr, int data); - -extern int current_default_layer; - -void init_helix_oled(void) { -#ifdef SSD1306OLED - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - iota_gfx_init(!has_usb()); // turns on the display -#endif -} - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#if defined(SSD1306OLED) || defined(OLED_ENABLE) - -# if defined(OLED_ENABLE) -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (is_keyboard_master()) { - return OLED_ROTATION_0; - } else { - return OLED_ROTATION_180; - } -} -# else -# define oled_write(data,flag) matrix_write(matrix, data) -# define oled_write_P(data,flag) matrix_write_P(matrix, data) -# endif - -# ifdef SSD1306OLED -void matrix_scan_user(void) { - iota_gfx_task(); // this is what updates the display continuously -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} -# endif - -# ifdef SSD1306OLED -static void render_logo(struct CharacterMatrix *matrix) { -# else -static void render_logo(void) { -# endif - - static const char helix_logo[] PROGMEM = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - oled_write_P(helix_logo, false); - char buf[30]; - char *bufp; -# ifdef RGBLIGHT_ENABLE - if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { - bufp = sprint2d(buf, " LED ", rgblight_get_mode()); -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(bufp, " scan:", get_matrix_scan_rate()); -# else - bufp = sprintd(bufp, ": ", rgblight_get_hue()/RGBLIGHT_HUE_STEP); - bufp = sprintd(bufp, ",", rgblight_get_sat()/RGBLIGHT_SAT_STEP); - bufp = sprintd(bufp, ",", rgblight_get_val()/RGBLIGHT_VAL_STEP); - bufp = sprints(bufp, " "); -# endif - oled_write(buf, false); -# ifndef SSD1306OLED - } else { -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(buf, " scan:", get_matrix_scan_rate()); - oled_write(buf, false); -# endif - oled_write_P( PSTR("\n"), false); -# endif - } -# else -# ifdef DEBUG_MATRIX_SCAN_RATE - bufp = sprintd(buf, " scan:", get_matrix_scan_rate()); - bufp = sprints(bufp, " "); - oled_write(buf, false); -# endif -# endif -} - -static const char Qwerty_name[] PROGMEM = " Qwerty"; -static const char Colemak_name[] PROGMEM = " Colemak"; -static const char Dvorak_name[] PROGMEM = " Dvorak"; -static const char Eucalyn_name[] PROGMEM = " Eucalyn"; -static const char Keypad_name[] PROGMEM = " Keypad"; - -static const char AUX_name[] PROGMEM = ":AUX"; -static const char KAUX_name[] PROGMEM = ":00"; -static const char Padfunc_name[] PROGMEM = ":PadFunc"; -static const char Lower_name[] PROGMEM = ":Func"; -static const char Raise_name[] PROGMEM = ":Extra"; -static const char Adjust_name[] PROGMEM = ":Adjust"; - -static const char *layer_names[] = { - [_QWERTY] = Qwerty_name, - [_COLEMAK] = Colemak_name, - [_DVORAK] = Dvorak_name, - [_EUCALYN]= Eucalyn_name, - [_KEYPAD] = Keypad_name, - [_AUX] = AUX_name, - [_KAUX] = KAUX_name, - [_LOWER] = Lower_name, - [_RAISE] = Raise_name, - [_PADFUNC]= Padfunc_name, - [_ADJUST] = Adjust_name -}; - -# ifdef SSD1306OLED -void render_status(struct CharacterMatrix *matrix) { -# else -void render_status(void) { -# endif - - // Render to mode icon - static const char os_logo[][2][3] PROGMEM ={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - oled_write_P(os_logo[0][0], false); - oled_write_P(PSTR("\n"), false); - oled_write_P(os_logo[0][1], false); - } else { - oled_write_P(os_logo[1][0], false); - oled_write_P(PSTR("\n"), false); - oled_write_P(os_logo[1][1], false); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - int name_num; - uint32_t lstate; - oled_write_P(layer_names[current_default_layer], false); -# ifdef DEBUG_MATRIX_SCAN_RATE - char buf[16]; - sprintd(buf, " scan:", get_matrix_scan_rate()); - oled_write(buf, false); -# endif - oled_write_P(PSTR("\n"), false); - for (lstate = layer_state, name_num = 0; - lstate && name_num < sizeof(layer_names)/sizeof(char *); - lstate >>=1, name_num++) { - if ((lstate & 1) != 0) { - if (layer_names[name_num]) { - oled_write_P(layer_names[name_num], false); - } - } - } - oled_write_P(PSTR("\n"), false); - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_P(led_state.num_lock ? PSTR("NUMLOCK ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CAPS ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("SCLK ") : PSTR(" "), false); -} - -# ifdef SSD1306OLED -# if OLED_UPDATE_INTERVAL > 0 -uint16_t oled_update_timeout; -# endif - -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - -# if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -# endif - -#if OLED_UPDATE_INTERVAL > 0 - if (timer_elapsed(oled_update_timeout) < OLED_UPDATE_INTERVAL) { - return; - } - oled_update_timeout = timer_read(); -#endif - matrix_clear(&matrix); - if (is_keyboard_master()) { - render_status(&matrix); - } else { - render_logo(&matrix); - } - matrix_update(&display, &matrix); -} -# else -void oled_task_user(void) { - -# if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -# endif - - if(is_keyboard_master()){ - render_status(); - }else{ - render_logo(); - } -} -# endif - -#endif diff --git a/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk b/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk index b0cca79129..a6ce7de118 100644 --- a/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev3_5rows/keymaps/five_rows/rules.mk @@ -1,9 +1,5 @@ -# QMK Standard Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -# See TOP/docs/config_options.md for more information. -# +USER_NAME := mtei + CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration # CONSOLE_ENABLE and COMMAND_ENABLE @@ -13,84 +9,3 @@ ENCODER_ENABLE = no LTO_ENABLE = no # if firmware size over limit, try this option LED_ANIMATIONS = yes - -CUSTOM_DELAY = yes - -ifneq ($(strip $(HELIX)),) - define KEYMAP_OPTION_PARSE - # parse 'dispoff', 'consle', 'back', 'oled', 'no-ani', 'mini-ani', 'lto', 'no-lto', 'no-enc', 'scan', 'scan-api' - $(if $(SHOW_PARCE),$(info parse .$1.)) #debug - ifeq ($(strip $1),dispoff) - OLED_ENABLE = no - RGBLIGHT_ENABLE = no - endif - ifeq ($(strip $1),console) - CONSOLE_ENABLE = yes - endif - ifeq ($(strip $1),debug) - DEBUG_CONFIG = yes - endif - ifneq ($(filter nodebug no-debug no_debug,$(strip $1)),) - DEBUG_CONFIG = no - endif - ifneq ($(filter enc,$(strip $1)),) - ENCODER_ENABLE = yes - endif - ifneq ($(filter noenc no-enc no_enc,$(strip $1)),) - ENCODER_ENABLE = no - endif - ifeq ($(strip $1),oled) - OLED_ENABLE = yes - endif - ifeq ($(strip $1),back) - RGBLIGHT_ENABLE = yes - endif - ifneq ($(filter na no_ani no-ani,$(strip $1)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter mini-ani mini_ani,$(strip $1)),) - LED_ANIMATIONS = mini - endif - ifneq ($(filter ani animation,$(strip $1)),) - LED_ANIMATIONS = yes - endif - ifeq ($(strip $1),lto) - LTO_ENABLE = yes - endif - ifneq ($(filter nolto no-lto no_lto,$(strip $1)),) - LTO_ENABLE = no - endif - ifeq ($(strip $1),scan) - # use DEBUG_MATRIX_SCAN_RATE - # see docs/newbs_testing_debugging.md - DEBUG_MATRIX_SCAN_RATE_ENABLE = yes - endif - ifeq ($(strip $1),scan-api) - # use DEBUG_MATRIX_SCAN_RATE - # see docs/newbs_testing_debugging.md - DEBUG_MATRIX_SCAN_RATE_ENABLE = api - endif - endef # end of KEYMAP_OPTION_PARSE - - COMMA=, - $(eval $(foreach A_OPTION_NAME,$(subst $(COMMA), ,$(HELIX)), \ - $(call KEYMAP_OPTION_PARSE,$(A_OPTION_NAME)))) -endif - -ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DLED_ANIMATIONS - OPT_DEFS += -DLED_ANIMATIONS_LEVEL=2 -endif - -ifeq ($(strip $(LED_ANIMATIONS)), mini) - OPT_DEFS += -DLED_ANIMATIONS - OPT_DEFS += -DLED_ANIMATIONS_LEVEL=1 -endif - -ifeq ($(strip $(CUSTOM_DELAY)),yes) - SRC += matrix_output_unselect_delay.c -endif - -ifeq ($(strip $(DEBUG_CONFIG)), yes) - OPT_DEFS += -DDEBUG_CONFIG -endif diff --git a/keyboards/helix/rev3_5rows/keymaps/via/config.h b/keyboards/helix/rev3_5rows/keymaps/via/config.h deleted file mode 100644 index ba446182d2..0000000000 --- a/keyboards/helix/rev3_5rows/keymaps/via/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2020 yushakobo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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/>. - */ - -#pragma once - -// place overrides here diff --git a/keyboards/helix/rev3_5rows/keymaps/via/keymap.c b/keyboards/helix/rev3_5rows/keymaps/via/keymap.c index b1d17c50fa..3dd9f2c630 100644 --- a/keyboards/helix/rev3_5rows/keymaps/via/keymap.c +++ b/keyboards/helix/rev3_5rows/keymaps/via/keymap.c @@ -49,12 +49,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | * `-------------------------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - MO(_ADJUST), KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + [_QWERTY] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + MO(_ADJUST), KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), /* Lower * ,-----------------------------------------. ,-----------------------------------------. @@ -69,12 +69,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Raise @@ -90,12 +90,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + [_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -111,12 +111,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ + [_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD ) }; diff --git a/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c b/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c index fb1a6f9f87..e951f627c8 100644 --- a/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c +++ b/keyboards/helix/rev3_5rows/keymaps/via/oled_display.c @@ -101,12 +101,13 @@ static void render_rgbled_status(bool full) { #endif } -void oled_task_user(void) { +bool oled_task_user(void) { if(is_keyboard_master()){ render_status(); }else{ render_logo(); render_rgbled_status(true); } + return false; } #endif diff --git a/keyboards/helix/rev3_5rows/rev3_5rows.c b/keyboards/helix/rev3_5rows/rev3_5rows.c index 963cc744e7..704f915510 100644 --- a/keyboards/helix/rev3_5rows/rev3_5rows.c +++ b/keyboards/helix/rev3_5rows/rev3_5rows.c @@ -83,8 +83,8 @@ char *sprint2d(char *buf, char *leadstr, int data) { return sprint_decimal(buf, data); } -__attribute__((weak)) -void oled_task_user(void) { +bool oled_task_kb(void) { + if (!oled_task_user()) { return false; } static const char PROGMEM helix_logo[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, @@ -109,5 +109,6 @@ void oled_task_user(void) { } else { oled_write_P(helix_logo, false); } + return false; } #endif diff --git a/keyboards/helix/rules.mk b/keyboards/helix/rules.mk index 974081835e..e5cf469689 100644 --- a/keyboards/helix/rules.mk +++ b/keyboards/helix/rules.mk @@ -4,9 +4,8 @@ MCU = atmega32u4 # Bootloader selection BOOTLOADER = caterina -# QMK Standard Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically +# Build Options +# change yes to no to disable # # See TOP/docs/config_options.md for more information. # @@ -15,12 +14,10 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = no # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend DEFAULT_FOLDER = helix/rev2 |