Mercurial > louis > kiibohd-controller
annotate Macro/PartialMap/trigger.h @ 433:0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
- Requires a recent KLL
- Functionality wise, nothing has changed
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sun, 08 May 2016 18:50:28 -0700 |
parents | |
children |
rev | line source |
---|---|
433
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
1 /* Copyright (C) 2014-2016 by Jacob Alexander |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
2 * |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
3 * This file is free software: you can redistribute it and/or modify |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
4 * it under the terms of the GNU General Public License as published by |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
5 * the Free Software Foundation, either version 3 of the License, or |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
6 * (at your option) any later version. |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
7 * |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
8 * This file is distributed in the hope that it will be useful, |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
12 * |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
13 * You should have received a copy of the GNU General Public License |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
14 * along with this file. If not, see <http://www.gnu.org/licenses/>. |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
15 */ |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
16 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
17 #pragma once |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
18 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
19 // ----- Includes ----- |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
20 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
21 // Compiler Includes |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
22 #include <stdint.h> |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
23 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
24 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
25 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
26 // ----- Functions ----- |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
27 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
28 // Updates trigger state, but does not add event to processing queue |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
29 void Trigger_state( uint8_t type, uint8_t state, uint8_t index ); |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
30 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
31 // Updates trigger state, adds event to processing queue |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
32 // If event was already added this cycle, it will be discarded, state is not updated, and returns 0 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
33 // Returns 1 otherwise |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
34 uint8_t Trigger_update( uint8_t type, uint8_t state, uint8_t index ); |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
35 |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
36 void Trigger_process(); |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
37 void Trigger_setup(); |
0f7a6b593dc4
Initial refactoring of PartialMap for supporting custom Triggers
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
38 |