Browse Source

Modified for ARM; cannot make the compilation detect OLED code.

pull/14484/head^2
Batuhan Başerdem 2 years ago
parent
commit
d995058de7
14 changed files with 176 additions and 53 deletions
  1. +9
    -1
      layouts/community/split_3x6_3/bbaserdem/README.md
  2. +10
    -0
      layouts/community/split_3x6_3/bbaserdem/chconf.h
  3. +42
    -3
      layouts/community/split_3x6_3/bbaserdem/config.h
  4. +8
    -0
      layouts/community/split_3x6_3/bbaserdem/halconf.h
  5. +25
    -10
      layouts/community/split_3x6_3/bbaserdem/keymap.c
  6. +9
    -0
      layouts/community/split_3x6_3/bbaserdem/mcuconf.h
  7. +20
    -3
      layouts/community/split_3x6_3/bbaserdem/rules.mk
  8. +1
    -1
      users/bbaserdem/bb-audio.c
  9. +7
    -3
      users/bbaserdem/bb-encoder.c
  10. +5
    -3
      users/bbaserdem/bb-encoder.h
  11. +3
    -0
      users/bbaserdem/bb-oled.c
  12. +26
    -23
      users/bbaserdem/bbaserdem.h
  13. +4
    -0
      users/bbaserdem/config.h
  14. +7
    -6
      users/bbaserdem/rules.mk

+ 9
- 1
layouts/community/split_3x6_3/bbaserdem/README.md View File

@ -5,6 +5,14 @@ Check out the [user readme](../../../../users/bbaserdem/README.md) for more info
Using [this](https://github.com/ItsWaffIe/waffle_corne) Proton-C compatible PCB.
Applying the similar keymap to [@waffle](https://github.com/ItsWaffIe/waffle_corne);
using their `crkbd:rev1:arm` build.
## Build
Build command: `CFLAGS="-Wno-error=deprecated" TBF`
Build commands;
* For ARM:
`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}`
* For ARM:
`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}`

+ 10
- 0
layouts/community/split_3x6_3/bbaserdem/chconf.h View File

@ -0,0 +1,10 @@
// Code pertaining the ARM crkbd version
#ifdef KEYBOARD_crkbd_rev1
#define CH_CFG_ST_RESOLUTION 16
#define CH_CFG_ST_FREQUENCY 10000
#if __has_include("platforms/chibios/common/configs/chconf.h")
# include_next "platforms/chibios/common/configs/chconf.h"
#else
# include_next "chconf.h"
#endif
#endif

+ 42
- 3
layouts/community/split_3x6_3/bbaserdem/config.h View File

@ -17,8 +17,47 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// elite-c: dfu-split-left/right
#define EE_HANDS
// Code pertaining to planck rev6
// Code pertaining to Corne ARM; from Waffle's keymap
#ifdef KEYBOARD_crkbd_rev1
// Corne overrides
#include "../../../../keyboards/crkbd/rev1/config.h"
// Undo Eeprom handedness
#undef EE_HANDS
#include "config_common.h"
#undef PRODUCT
#undef MANUFACTURER
#define MANUFACTURER Waffles
#define PRODUCT Protorne Keyboard
#undef USE_I2C
#undef SSD1306OLED
#define MASTER_RIGHT
#ifdef AUDIO_ENABLE
#define AUDIO_PIN A5
#endif
#define USE_SERIAL_PD2
#ifdef RGB_MATRIX_ENABLE
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100
#define RGB_MATRIX_SPLIT { 27, 27 }
#define SPLIT_TRANSPORT_MIRROR
#endif
#undef RGBLED_NUM
#define RGBLED_NUM 54
#undef RGB_DI_PIN
#define RGB_DI_PIN B5
#ifdef OLED_DRIVER_ENABLE
#define OLED_TIMEOUT 50000
#define OLED_UPDATE_INTERVAL 100
#endif
#define WS2812_PWM_DRIVER PWMD3
#define WS2812_PWM_CHANNEL 3
#define WS2812_PWM_PAL_MODE 2
#define WS2812_DMA_STREAM STM32_DMA1_STREAM3
#define WS2812_DMA_CHANNEL 3
#undef SOFT_SERIAL_PIN
#define SOFT_SERIAL_PIN D3
#define SERIAL_USART_SPEED 921600
#define SERIAL_USART_DRIVER SD1
#define SERIAL_USART_TX_PAL_MODE 7
#define ENCODERS_PAD_A { B2 }
#define ENCODERS_PAD_B { B6 }
#define ENCODERS_PAD_A_RIGHT { B2 }
#define ENCODERS_PAD_B_RIGHT { B6 }
#endif

+ 8
- 0
layouts/community/split_3x6_3/bbaserdem/halconf.h View File

@ -0,0 +1,8 @@
#pragma once
#ifdef KEYBOARD_crkbd_rev1
// #define HAL_USE_DAC TRUE
#define HAL_USE_PWM TRUE
#define HAL_USE_SERIAL TRUE
#include_next <halconf.h>
#endif

+ 25
- 10
layouts/community/split_3x6_3/bbaserdem/keymap.c View File

@ -27,55 +27,55 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_split_3x6_3_wrapper(
_BL1_1_,_BL1_5_,_BR1_5_,_BR1_1_,
BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1,
_BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_,
_BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_,
_BL4_3_,_BR4_3_
),
[_CHAR] = LAYOUT_split_3x6_3_wrapper(
XXXXXXX,_CL1_5_,_CR1_5_,XXXXXXX,
_______,_CL1_5_,_CR1_5_,_______,
XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX,
XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX,
_CL4_3_,_CR4_3_
),
[_GAME] = LAYOUT_split_3x6_3_wrapper(
_GA1_1_,_GA1_5_,___6___,
_______,_GA1_5_,___6___,
_GA2_1_,_GA2_5_,___6___,
_GA3_1_,_GA3_5_,___6___,
_GA4_3_,___3___
),
[_MEDI] = LAYOUT_split_3x6_3_wrapper(
___6___,_ME1_5_,xxx1xxx,
___6___,_ME1_5_,_______,
___6___,_ME2_5_,xxx1xxx,
___6___,_ME3_5_,xxx1xxx,
___3___,_ME4_3_
),
[_NAVI] = LAYOUT_split_3x6_3_wrapper(
___6___,_NA1_5_,xxx1xxx,
___6___,_NA1_5_,_______,
___6___,_NA2_5_,xxx1xxx,
___6___,_NA3_5_,xxx1xxx,
___3___,_NA4_3_
),
[_SYMB] = LAYOUT_split_3x6_3_wrapper(
___6___,_SY1_5_,xxx1xxx,
___6___,_SY1_5_,_______,
___6___,_SY2_5_,xxx1xxx,
___6___,_SY3_5_,xxx1xxx,
___3___,_SY4_3_
),
[_NUMB] = LAYOUT_split_3x6_3_wrapper(
xxx1xxx,_NU1_5_,___6___,
_______,_NU1_5_,___6___,
xxx1xxx,_NU2_5_,___6___,
xxx1xxx,_NU3_5_,___6___,
_NU4_3_,___3___
),
[_FUNC] = LAYOUT_split_3x6_3_wrapper(
xxx1xxx,_FU1_5_,___6___,
_______,_FU1_5_,___6___,
xxx1xxx,_FU2_5_,___6___,
xxx1xxx,_FU3_5_,___6___,
_FU4_3_,___3___
),
[_MOUS] = LAYOUT_split_3x6_3_wrapper(
xxx1xxx,_MO1_5_,___6___,
_______,_MO1_5_,___6___,
xxx1xxx,_MO2_5_,___6___,
xxx1xxx,_MO3_5_,___6___,
_MO4_3_,___3___
@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// crkbd
#if defined(KEYBOARD_crkbd_rev1)
/* This is left-right for planck light indicator light
/* This is left-right for CRKBD indicator light
* - The LED 42 is for spacebar specifically, leave it out of the matrix
* - This is how it looks like
*      
@ -117,6 +117,21 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) {
rgb_matrix_set_color(i, red, green, blue);
}
}
#ifdef AUDIO_ENABLE
// Audio requires some fixes to work on @waffle's PCB
// ! Copy pasted from ItsWaffle's waffle fork
void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this
// Set audio pins to analog mode
palSetLineMode(A5, PAL_MODE_INPUT_ANALOG);
palSetLineMode(B1, PAL_MODE_INPUT_ANALOG);
}
void keyboard_post_init_keymap(void) {
// Enable OPAMP1 as A5 B1 follower
OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN;
}
#endif // End of audio specific stuff
// End of differentiations
#endif


+ 9
- 0
layouts/community/split_3x6_3/bbaserdem/mcuconf.h View File

@ -0,0 +1,9 @@
#pragma once
#ifdef KEYBOARD_crkbd_rev1
#include_next <mcuconf.h>
#undef STM32_PWM_USE_TIM3
#define STM32_PWM_USE_TIM3 TRUE
#undef STM32_SERIAL_USE_USART1
#define STM32_SERIAL_USE_USART1 TRUE
#endif

+ 20
- 3
layouts/community/split_3x6_3/bbaserdem/rules.mk View File

@ -10,9 +10,26 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Corne keyboard
# Corne keyboard; with ARM
ifneq (,$(findstring crkbd/rev1,$(KEYBOARD)))
RGBLIGHT_ENABLE = no
# My usual features
AUDIO_ENABLE = yes #breaks reset keycode
BACKLIGHT_ENABLE = no
ENCODER_ENABLE = yes
RGB_MATRIX_ENABLE = yes
OLED_DRIVER_ENABLE = no
RGBLIGHT_ENABLE = no
OLED_DRIVER_ENABLE = yes
# Proton C related stuff
MCU = STM32F303
COVERT_TO_PROTON_C = yes
DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox
AUDIO_DRIVER = dac_basic
SERIAL_DRIVER = usart
WS2812_DRIVER = pwm
VIA_ENABLE = yes
SPLIT_KEYBOARD = yes
OLED_DRIVER = SSD1306 # Enables the use of OLED displays
# POINTING_DEVICE_ENABLE = no
# SRC += pimoroni_trackball.c
QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28
endif

+ 1
- 1
users/bbaserdem/bb-audio.c View File

@ -22,7 +22,7 @@ float tone_game_intro[][2] = GAME_ON_SONG;
float tone_game_outro[][2] = GAME_OFF_SONG;
// Audio playing when layer changes
uint32_t layer_state_set_audio(uint32_t state) {
layer_state_t layer_state_set_audio(layer_state_t state) {
// Get this layer
static bool prev_game = false;


+ 7
- 3
users/bbaserdem/bb-encoder.c View File

@ -12,6 +12,9 @@ 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 "bb-encoder.h"
#ifdef VELOCIKEY_ENABLE
#include "velocikey.h"
#endif
/* ROTARY ENCODER
* This contains my general rotary encoder code
* Encoders each have a list of different modes they can be in.
@ -38,8 +41,8 @@ void keyboard_post_init_encoder(void) {
}
// Oled string printing for given layer and index; ONLY for OLED
#ifdef OLED_DRIVER_ENABLE
void oled_encoder_state_5char(uint8_t index, uint8_t layer) {
#ifdef OLED_DRIVER_ENABLE
// Get the layer straight from the main function
switch (layer) {
// If RGB control mode is enabled
@ -124,11 +127,11 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) {
}
break;
}
}
#endif
}
// Encoder scroll functionality
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
// Differentiate layer roles
switch (get_highest_layer(layer_state)) {
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
@ -322,6 +325,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}
return true;
}
void encoder_click_action(uint8_t index) {


+ 5
- 3
users/bbaserdem/bb-encoder.h View File

@ -13,13 +13,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "bbaserdem.h"
#ifdef VELOCIKEY_ENABLE
#include "velocikey.h"
#endif
// Code to print to OLED
#ifdef ENCODER_ENABLE
void oled_encoder_state_5char(uint8_t index, uint8_t layer);
#endif
// Hook to encoder stuff
void encoder_update_user(uint8_t index, bool clockwise);
bool encoder_update_user(uint8_t index, bool clockwise);
// Complicated code for what the encoder keys do when pressed
bool process_record_encoder(uint16_t keycode, keyrecord_t *record);
// Initializing the encoder array


+ 3
- 0
users/bbaserdem/bb-oled.c View File

@ -12,6 +12,9 @@ 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 "bb-oled.h"
#ifdef ENCODER_ENABLE
#include "bb-encoder.h"
#endif
//#include <stdio.h>
/* ROTARY ENCODER
* This contains my general rotary encoder code


+ 26
- 23
users/bbaserdem/bbaserdem.h View File

@ -13,6 +13,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include QMK_KEYBOARD_H
#include "quantum.h"
/* Besides loading libraries and definitions, this file has my layout defs
* LAYOUTS:
@ -302,35 +303,37 @@ enum userspace_layers {
*
* AltGr -none- Shift Shift+AltGr
*
* If there is an exclamation mark; it indicates that
* If there is an exclamation mark; it indicates a dead key on this map.
*/
/* Base layout
* QWERTY
*
* [ { q Q w W e E r R t T y Y u U i I o O p P ] }
* ` ~ q Q w W e E r R t T y Y u U i I o O p P < >
*
* \ | a A s S d D f F g G h H j J k K l L ; : ' "
* [ { a A s S d D f F g G h H j J k K l L ; : ] }
* GuiAltCtrSft SftCtrAltGui
* ` ~ z Z x X c C v V b B n N m M , < . > / ? < >
* \ | z Z x X c C v V b B n N m M , < . > / ? ' "
* AltGr AltGr
* Del Tab Space Enter Esc BkSpc
* MedNavSym NumFunMou
* DVORAK
*
* / ? ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ = +
* ` ~ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < >
*
* \ | a A o O e E u U i I d D h H t T n N s S - _
* / ? a A o O e E u U i I d D h H t T n N s S = +
* GuiAltCtrSft SftCtrAltGui
* ` ~ ; : q Q j J k K x X b B m M w W v V z Z < >
* \ | ; : q Q j J k K x X b B m M w W v V z Z - _
* AltGr AltGr
* Del Tab Space Enter Esc BkSpc
* MedNavSym NumFunMou
* TURKISH F
* ! !
* äq @f F g G ğ Ğ ı I ôo ¥d D ®r R n N °h H £p P ~w W
* ! ! !
* `x ûu îi İÎe E âa ûü ÜÛ t T k K µm M l L ´y #ş Şǎ
* GuiAltCtrSft SftCtrAlt!Gui
* ¬+ *±«j J<»ö Ö>v V ¢c C©ç Ç z Z §s S ×b B ÷. :ȧ·, ; |< >¦
*
* ¬+ *±@f F g G ğ Ğ ı I ôo ¥d D ®r R n N °h H £p P |< >¦
* ! ! !
* äq ûu îi İÎe E âa ûü ÜÛ t T k K µm M l L ´y ~w W
* !GuiAltCtrSft SftCtrAlt!Gui !
* `x «j J<»ö Ö>v V ¢c C©ç Ç z Z §s S ×b B ÷. :ȧ·, ; #ş Şǎ
* AltGr AltGr
* Del Tab Space Enter Esc BkSpc
* MedNavSym NumFunMou
@ -345,12 +348,12 @@ enum userspace_layers {
#define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC
#define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP
// The extra line for the 6th (or 0th) row
#define _BL1_1_ KC_LBRC
#define _BR1_1_ KC_RBRC
#define _BL2_1_ KC_BSLS
#define _BR2_1_ KC_QUOT
#define _BL3_1_ KC_GRV
#define _BR3_1_ KC_NUBS
#define _BL1_1_ KC_GRV
#define _BR1_1_ KC_NUBS
#define _BL2_1_ KC_LBRC
#define _BR2_1_ KC_RBRC
#define _BL3_1_ KC_BSLS
#define _BR3_1_ KC_QUOT
/* Extra characters layer
* This is accessed using unicode; so IBus compatible apps only.
@ -377,7 +380,7 @@ enum userspace_layers {
/* Game layer
* This layer turns off the tap-hold keys for the left half.
*
* ` ~ Q W E R T
* Q W E R T
*
* Tab A S D F G
*
@ -387,7 +390,7 @@ enum userspace_layers {
*
*/
#define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T
#define _GA1_1_ KC_GRV
#define _GA1_1_ _______
#define _GA2_5_ KC_A, KC_S, KC_D, KC_F, KC_G
#define _GA2_1_ KC_TAB
#define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B
@ -449,9 +452,9 @@ enum userspace_layers {
* Enter Esc BkSpc
*
* Turkish F
* (AltGr is right on the central column, keys on main layer are omitted)
* (AltGr is right on the central column, red. keys on main layer are omitted)
*
* / \ - | Char.
* ¬+ *± / \ - | Char.
*
* ) ± = ° CapsL
*


+ 4
- 0
users/bbaserdem/config.h View File

@ -136,4 +136,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
// Some more config options
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 // Set maximum brightness
#define RGB_MATRIX_KEYPRESSES // React to key presses
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects
#endif

+ 7
- 6
users/bbaserdem/rules.mk View File

@ -20,15 +20,16 @@ EXTRAKEY_ENABLE = yes # OS signals like volume control
UNICODEMAP_ENABLE = yes # Used for unicode character emulation
KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general
TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold
VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed
WPM_ENABLE = no # Get WPM reports as you type
VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed
WPM_ENABLE = yes # Get WPM reports as you type
NKRO_ENABLE = yes # Default is 6KRO which is plenty
BLUETOOTH_ENABLE = no # For bluetooth
# These should be disabled in all boards
BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed
CONSOLE_ENABLE = no # Allows console output with a command
COMMAND_ENABLE = no # Some bootmagic thing i dont use
SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested.
NKRO_ENABLE = no # Default is 6KRO which is plenty
MIDI_ENABLE = no # Midi driver (untested)
UNICODE_ENABLE = no # We use unicodemap, not unicode
UCIS_ENABLE = no # We use unicodemap, not ucis
@ -37,12 +38,12 @@ VARIABLE_TRACE = no # Allows debugging variables
API_SYSEX_ENABLE = no # Allows OS to send signals.
# Manually configure these on each keyboard individually
# BLUETOOTH_ENABLE # For bluetooth
# AUDIO_ENABLE # Audio stuff
# BACKLIGHT_ENABLE # Switch LEDs
# RGBLIGHT_ENABLE # LED strip
# RGB_MATRIX_ENABLE # Per-key RGB LED
# ENCODER_ENABLE # Rotary encoder
# RGB_MATRIX_ENABLE # Per-key RGB LED
# RGBLIGHT_ENABLE # LED strip; compacter code for small leds.
# OLED_DRIVER_ENABLE # For OLED
# Userspace code
SRC += bbaserdem.c


Loading…
Cancel
Save