This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keyboard annepro2 bidir led comms (#5)
* Added bidirectional shine comms and moved led functionality to new file * Added bidirectional shine comms and moved led functionality to new file * Restore original functionality to existing keymaps using new shine commands * Fix dangling bracketless if statements * PR cleanup
- Loading branch information
Showing
8 changed files
with
95 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
SRC = \ | ||
matrix.c \ | ||
hardfault_handler.c \ | ||
annepro2_ble.c | ||
annepro2_ble.c \ | ||
qmk_ap2_led.c | ||
|
||
LAYOUTS += | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
SRC = \ | ||
matrix.c \ | ||
hardfault_handler.c \ | ||
annepro2_ble.c | ||
annepro2_ble.c \ | ||
qmk_ap2_led.c | ||
|
||
LAYOUTS += | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#include "hal.h" | ||
#include "annepro2.h" | ||
#include "qmk_ap2_led.h" | ||
|
||
void annepro2LedDisable(void) | ||
{ | ||
sdPut(&SD0, CMD_LED_OFF); | ||
} | ||
|
||
void annepro2LedEnable(void) | ||
{ | ||
sdPut(&SD0, CMD_LED_ON); | ||
} | ||
|
||
void annepro2LedUpdate(uint8_t row, uint8_t col) | ||
{ | ||
sdPut(&SD0, CMD_LED_SET); | ||
sdPut(&SD0, row); | ||
sdPut(&SD0, col); | ||
sdWrite(&SD0, (uint8_t *)&annepro2LedMatrix[row * MATRIX_COLS + col], sizeof(uint16_t)); | ||
} | ||
|
||
void annepro2LedUpdateRow(uint8_t row) | ||
{ | ||
sdPut(&SD0, CMD_LED_SET_ROW); | ||
sdPut(&SD0, row); | ||
sdWrite(&SD0, (uint8_t *)&annepro2LedMatrix[row * MATRIX_COLS], sizeof(uint16_t) * MATRIX_COLS); | ||
} | ||
|
||
void annepro2LedSetProfile(uint8_t prof) | ||
{ | ||
sdPut(&SD0, CMD_LED_SET_PROFILE); | ||
sdPut(&SD0, prof); | ||
} | ||
|
||
uint8_t annepro2LedGetProfile() | ||
{ | ||
uint8_t buf = 0; | ||
sdPut(&SD0, CMD_LED_GET_PROFILE); | ||
buf = sdGet(&SD0); | ||
return buf; | ||
} | ||
|
||
uint8_t annepro2LedGetNumProfiles() | ||
{ | ||
uint8_t buf = 0; | ||
sdPut(&SD0, CMD_LED_GET_NUM_PROFILES); | ||
buf = sdGet(&SD0); | ||
return buf; | ||
} | ||
|
||
void annepro2LedNextProfile() | ||
{ | ||
sdPut(&SD0, CMD_LED_NEXT_PROFILE); | ||
} | ||
|
||
void annepro2LedPrevProfile() | ||
{ | ||
sdPut(&SD0, CMD_LED_PREV_PROFILE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters