Skip to content

Commit

Permalink
Practice60 RGB and PWM Backlight (qmk#4929)
Browse files Browse the repository at this point in the history
* Update Practice60 to enable RGB via SPI DMA and use PWM backlight breathing

* Correct stm32f103c8t6 flash size in eeprom definition

* Remove unused files and improve ifdef checks

* Update quantum/rgblight.c

Co-Authored-By: awkannan <[email protected]>

* Update quantum/rgblight.c

Co-Authored-By: awkannan <[email protected]>

* EEPROM implementation fix and updated p60 code

* Update define

* Remove dead code

* Update keymap to remove test key

* Update keymap again
  • Loading branch information
Andrew Kannan authored and drashna committed Jan 29, 2019
1 parent d912041 commit 0f507f0
Show file tree
Hide file tree
Showing 17 changed files with 328 additions and 220 deletions.
4 changes: 2 additions & 2 deletions drivers/avr/ws2812.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ unsigned char I2C_Write(unsigned char c)
c <<= 1;
}


I2C_WriteBit(0);
_delay_us(I2C_DELAY);
_delay_us(I2C_DELAY);

// _delay_us(I2C_DELAY);
//return I2C_ReadBit();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/handwired/practice60/bootloader_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

// STM32F103* does NOT have an USB bootloader in ROM (only serial),
// so setting anything here does not make much sense
// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
#define STM32_BOOTLOADER_ADDRESS 0x80000000
13 changes: 12 additions & 1 deletion keyboards/handwired/practice60/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 }
#define DIODE_DIRECTION COL2ROW

#define BACKLIGHT_LEVELS 1
#define BACKLIGHT_LEVELS 6
#define BACKLIGHT_BREATHING
#define BREATHING_PERIOD 6

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
Expand All @@ -48,6 +50,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

#define RGBLIGHT_ANIMATIONS

#define WS2812_LED_N 9
#define RGBLED_NUM WS2812_LED_N
#define PORT_WS2812 GPIOB
#define PIN_WS2812 15
#define WS2812_SPI SPID2


/*
* Feature disable options
* These options are also useful to firmware size reduction.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/handwired/practice60/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
* @brief Enables the PWM subsystem.
*/
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
#define HAL_USE_PWM FALSE
#define HAL_USE_PWM TRUE
#endif

/**
Expand Down
80 changes: 0 additions & 80 deletions keyboards/handwired/practice60/hsv2rgb.c

This file was deleted.

23 changes: 0 additions & 23 deletions keyboards/handwired/practice60/hsv2rgb.h

This file was deleted.

6 changes: 3 additions & 3 deletions keyboards/handwired/practice60/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ enum custom_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_60_ansi(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MT(MOD_LSFT, KC_Y), KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL
),

[_FN1] = LAYOUT_60_ansi(
KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, \
KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \
RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_GRV, _______, _______, _______, _______, _______, _______, _______
)
Expand Down
Loading

0 comments on commit 0f507f0

Please sign in to comment.