2018-08-29 21:07:52 +02:00
|
|
|
/*
|
|
|
|
Copyright 2018 Massdrop Inc.
|
|
|
|
|
|
|
|
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 "samd51j18a.h"
|
|
|
|
#include "conf_usb.h"
|
|
|
|
#include "udd.h"
|
|
|
|
|
|
|
|
uint8_t keyboard_protocol = 1;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_suspend_action(void) { ui_powerdown(); }
|
2018-08-29 21:07:52 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_resume_action(void) { ui_wakeup(); }
|
2018-08-29 21:07:52 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_sof_action(void) { ui_process(udd_get_frame_number()); }
|
2018-08-29 21:07:52 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_remotewakeup_enable(void) { ui_wakeup_enable(); }
|
2018-08-29 21:07:52 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_remotewakeup_disable(void) { ui_wakeup_disable(); }
|
2018-08-29 21:07:52 +02:00
|
|
|
|
|
|
|
#ifdef KBD
|
|
|
|
volatile bool main_b_kbd_enable = false;
|
2019-08-30 20:19:03 +02:00
|
|
|
bool main_kbd_enable(void) {
|
2018-08-29 21:07:52 +02:00
|
|
|
main_b_kbd_enable = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_kbd_disable(void) { main_b_kbd_enable = false; }
|
2018-08-29 21:07:52 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NKRO
|
|
|
|
volatile bool main_b_nkro_enable = false;
|
2019-08-30 20:19:03 +02:00
|
|
|
bool main_nkro_enable(void) {
|
2018-08-29 21:07:52 +02:00
|
|
|
main_b_nkro_enable = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_nkro_disable(void) { main_b_nkro_enable = false; }
|
2018-08-29 21:07:52 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef EXK
|
|
|
|
volatile bool main_b_exk_enable = false;
|
2019-08-30 20:19:03 +02:00
|
|
|
bool main_exk_enable(void) {
|
2018-08-29 21:07:52 +02:00
|
|
|
main_b_exk_enable = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_exk_disable(void) { main_b_exk_enable = false; }
|
2018-08-29 21:07:52 +02:00
|
|
|
#endif
|
|
|
|
|
2018-10-09 21:14:13 +02:00
|
|
|
#ifdef CON
|
|
|
|
volatile bool main_b_con_enable = false;
|
2019-08-30 20:19:03 +02:00
|
|
|
bool main_con_enable(void) {
|
2018-10-09 21:14:13 +02:00
|
|
|
main_b_con_enable = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_con_disable(void) { main_b_con_enable = false; }
|
2018-10-09 21:14:13 +02:00
|
|
|
#endif
|
|
|
|
|
2018-08-29 21:07:52 +02:00
|
|
|
#ifdef MOU
|
|
|
|
volatile bool main_b_mou_enable = false;
|
2019-08-30 20:19:03 +02:00
|
|
|
bool main_mou_enable(void) {
|
2018-08-29 21:07:52 +02:00
|
|
|
main_b_mou_enable = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_mou_disable(void) { main_b_mou_enable = false; }
|
2018-08-29 21:07:52 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RAW
|
|
|
|
volatile bool main_b_raw_enable = false;
|
2019-08-30 20:19:03 +02:00
|
|
|
bool main_raw_enable(void) {
|
2018-08-29 21:07:52 +02:00
|
|
|
main_b_raw_enable = true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
void main_raw_disable(void) { main_b_raw_enable = false; }
|
2018-08-29 21:07:52 +02:00
|
|
|
#endif
|