mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-12 19:45:44 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ed80874f72 | ||
![]() |
23e942ae4e | ||
![]() |
c077300e19 | ||
![]() |
11f12d386b |
@@ -50,7 +50,7 @@ After opening a new MSYS2 MinGW 64-bit terminal, make sure `pacman` is up to dat
|
||||
|
||||
You may be asked to close and reopen the window. Do this and keep running the above command until it says `there is nothing to do`. Then run the following:
|
||||
|
||||
pacman -S git python3-pip
|
||||
pacman -S git mingw-w64-x86_64-toolchain mingw-w64-x86_64-python3-pip
|
||||
python3 -m pip install qmk
|
||||
|
||||
### macOS
|
||||
|
37
keyboards/bm16a/keymaps/factory/keymap.c
Normal file
37
keyboards/bm16a/keymaps/factory/keymap.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/* Copyright 2019
|
||||
*
|
||||
* 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
|
||||
|
||||
enum layers {
|
||||
_BASE = 0,
|
||||
_FN1,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_BASE] = LAYOUT_ortho_4x4(
|
||||
KC_P7, KC_P8, KC_P9, KC_PMNS,
|
||||
KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||
KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_P0, KC_PDOT, KC_SPC, MO(_FN1)
|
||||
),
|
||||
[_FN1] = LAYOUT_ortho_4x4(
|
||||
RESET, KC_PAST, KC_PSLS, _______,
|
||||
BL_TOGG, BL_DEC, BL_INC, BL_STEP,
|
||||
RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD,
|
||||
RGB_SAI, RGB_SAD, _______, _______
|
||||
)
|
||||
};
|
4
keyboards/bm16a/keymaps/factory/readme.md
Normal file
4
keyboards/bm16a/keymaps/factory/readme.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# A factory-like keymap for the bm16a
|
||||
|
||||
This keymap recreates the stock layout this keypad ships with. Use it if you want to return to stock, but with QMK.
|
||||
|
@@ -166,7 +166,7 @@
|
||||
|
||||
// DEPRECATED
|
||||
#define IT_BKSL IT_BSLS
|
||||
#define IT_QUOT IT_APOS
|
||||
#define IT_APOS IT_QUOT
|
||||
#define IT_IACC IT_IGRV
|
||||
#define IT_EACC IT_EGRV
|
||||
#define IT_OACC IT_OGRV
|
||||
|
@@ -5,6 +5,30 @@
|
||||
#include "led.h"
|
||||
#include "sleep_led.h"
|
||||
|
||||
#ifndef SLEEP_LED_TIMER
|
||||
# define SLEEP_LED_TIMER 1
|
||||
#endif
|
||||
|
||||
#if SLEEP_LED_TIMER == 1
|
||||
# define TCCRxB TCCR1B
|
||||
# define TIMERx_COMPA_vect TIMER1_COMPA_vect
|
||||
# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register
|
||||
# define TIMSKx TIMSK
|
||||
# else
|
||||
# define TIMSKx TIMSK1
|
||||
# endif
|
||||
# define OCIExA OCIE1A
|
||||
# define OCRxx OCR1A
|
||||
#elif SLEEP_LED_TIMER == 3
|
||||
# define TCCRxB TCCR3B
|
||||
# define TIMERx_COMPA_vect TIMER3_COMPA_vect
|
||||
# define TIMSKx TIMSK3
|
||||
# define OCIExA OCIE3A
|
||||
# define OCRxx OCR3A
|
||||
#else
|
||||
error("Invalid SLEEP_LED_TIMER config")
|
||||
#endif
|
||||
|
||||
/* Software PWM
|
||||
* ______ ______ __
|
||||
* | ON |___OFF___| ON |___OFF___| ....
|
||||
@@ -25,15 +49,14 @@
|
||||
void sleep_led_init(void) {
|
||||
/* Timer1 setup */
|
||||
/* CTC mode */
|
||||
TCCR1B |= _BV(WGM12);
|
||||
TCCRxB |= _BV(WGM12);
|
||||
/* Clock selelct: clk/1 */
|
||||
TCCR1B |= _BV(CS10);
|
||||
TCCRxB |= _BV(CS10);
|
||||
/* Set TOP value */
|
||||
uint8_t sreg = SREG;
|
||||
cli();
|
||||
OCR1AH = (SLEEP_LED_TIMER_TOP >> 8) & 0xff;
|
||||
OCR1AL = SLEEP_LED_TIMER_TOP & 0xff;
|
||||
SREG = sreg;
|
||||
OCRxx = SLEEP_LED_TIMER_TOP;
|
||||
SREG = sreg;
|
||||
}
|
||||
|
||||
/** \brief Sleep LED enable
|
||||
@@ -42,7 +65,7 @@ void sleep_led_init(void) {
|
||||
*/
|
||||
void sleep_led_enable(void) {
|
||||
/* Enable Compare Match Interrupt */
|
||||
TIMSK1 |= _BV(OCIE1A);
|
||||
TIMSKx |= _BV(OCIExA);
|
||||
}
|
||||
|
||||
/** \brief Sleep LED disable
|
||||
@@ -51,7 +74,7 @@ void sleep_led_enable(void) {
|
||||
*/
|
||||
void sleep_led_disable(void) {
|
||||
/* Disable Compare Match Interrupt */
|
||||
TIMSK1 &= ~_BV(OCIE1A);
|
||||
TIMSKx &= ~_BV(OCIExA);
|
||||
}
|
||||
|
||||
/** \brief Sleep LED toggle
|
||||
@@ -60,7 +83,7 @@ void sleep_led_disable(void) {
|
||||
*/
|
||||
void sleep_led_toggle(void) {
|
||||
/* Disable Compare Match Interrupt */
|
||||
TIMSK1 ^= _BV(OCIE1A);
|
||||
TIMSKx ^= _BV(OCIExA);
|
||||
}
|
||||
|
||||
/** \brief Breathing Sleep LED brighness(PWM On period) table
|
||||
@@ -72,7 +95,7 @@ void sleep_led_toggle(void) {
|
||||
*/
|
||||
static const uint8_t breathing_table[64] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 10, 15, 23, 32, 44, 58, 74, 93, 113, 135, 157, 179, 199, 218, 233, 245, 252, 255, 252, 245, 233, 218, 199, 179, 157, 135, 113, 93, 74, 58, 44, 32, 23, 15, 10, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
ISR(TIMER1_COMPA_vect) {
|
||||
ISR(TIMERx_COMPA_vect) {
|
||||
/* Software PWM
|
||||
* timer:1111 1111 1111 1111
|
||||
* \_____/\/ \_______/____ count(0-255)
|
||||
|
@@ -20,6 +20,9 @@
|
||||
#include "timer.h"
|
||||
#include "uart.h"
|
||||
#include "debug.h"
|
||||
#ifdef SLEEP_LED_ENABLE
|
||||
# include "sleep_led.h"
|
||||
#endif
|
||||
|
||||
#define UART_BAUD_RATE 115200
|
||||
|
||||
@@ -59,6 +62,9 @@ int main(void) {
|
||||
initForUsbConnectivity();
|
||||
|
||||
keyboard_init();
|
||||
#ifdef SLEEP_LED_ENABLE
|
||||
sleep_led_init();
|
||||
#endif
|
||||
|
||||
debug("main loop\n");
|
||||
while (1) {
|
||||
@@ -67,10 +73,16 @@ int main(void) {
|
||||
suspended = false;
|
||||
usbSofCount = 0;
|
||||
last_timer = timer_read();
|
||||
# ifdef SLEEP_LED_ENABLE
|
||||
sleep_led_disable();
|
||||
# endif
|
||||
} else {
|
||||
// Suspend when no SOF in 3ms-10ms(7.1.7.4 Suspending of USB1.1)
|
||||
if (timer_elapsed(last_timer) > 5) {
|
||||
suspended = true;
|
||||
# ifdef SLEEP_LED_ENABLE
|
||||
sleep_led_enable();
|
||||
# endif
|
||||
/*
|
||||
uart_putchar('S');
|
||||
_delay_ms(1);
|
||||
|
Reference in New Issue
Block a user