Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Leopold keyboards and add support for new FC980C controller #22260

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/mappings/keyboard_aliases.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@
"exclusive/e85": {
"target": "exclusive/e85/hotswap"
},
"fc660c": {
"target": "leopold/fc660c"
},
"fc980c": {
"target": "leopold/fc980c/hasu"
},
"gh60": {
"target": "gh60/revc"
},
Expand Down
52 changes: 0 additions & 52 deletions keyboards/fc660c/ad5258.c

This file was deleted.

60 changes: 0 additions & 60 deletions keyboards/fc660c/fc660c.c

This file was deleted.

52 changes: 0 additions & 52 deletions keyboards/fc980c/ad5258.c

This file was deleted.

60 changes: 0 additions & 60 deletions keyboards/fc980c/fc980c.c

This file was deleted.

9 changes: 0 additions & 9 deletions keyboards/fc980c/keymaps/actuation-point-example/README.md

This file was deleted.

81 changes: 0 additions & 81 deletions keyboards/fc980c/keymaps/actuation-point-example/keymap.c

This file was deleted.

53 changes: 53 additions & 0 deletions keyboards/leopold/actuation_point.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
Copyright 2017 Balz Guenat

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 "actuation_point.h"

#include "ad5258.h"

#include "util.h"

#ifdef ACTUATION_DEPTH_ADJUSTMENT
int8_t actuation_point_make_shallower(void) {
return actuation_point_adjust(-1 * ACTUATION_DEPTH_ADJUSTMENT);
}

int8_t actuation_point_make_deeper(void) {
return actuation_point_adjust(ACTUATION_DEPTH_ADJUSTMENT);
}

int8_t actuation_point_adjust(int8_t offset) {
int8_t ret = -1;
int8_t rdac = ad5258_read_rdac();

if (rdac >= 0) {
int8_t rdac_new = rdac + offset;

if (offset > 0) {
ret = ad5258_write_rdac(MIN(AD5258_RDAC_MAX, rdac_new));
} else if (offset < 0) {
ret = ad5258_write_rdac(MAX(AD5258_RDAC_MIN, rdac_new));
}
}

return ret;
}

void actuation_point_reset(void) {
ad5258_restore_from_eeprom();
}
#endif
Loading