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

More big board support #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
24 changes: 16 additions & 8 deletions Firmware/OpeNITHM/AutoTouchboard.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
#include "AutoTouchboard.h"

#if NUM_SENSORS == 32
#ifndef ALT_TOUCHKEY_ORDER
#if (defined(OPENITHM_FULL_V1_0) || defined(OPENITHM_FULL2_0_UP))
static const int sensorMap[] = {
11, 3, 10, 2, 9, 1, 8, 0,
31, 23, 30, 22, 29, 21, 28, 20,
27, 19, 26, 18, 25, 17, 24, 16,
15, 7, 14, 6, 13, 5, 12, 4
};
#else
static const int sensorMap[] = {
7, 4, 5, 6, 2, 1, 3, 0,
31, 28, 29, 30, 26, 25, 27, 24,
23, 20, 21, 22, 18, 17, 19, 16,
15, 12, 13, 14, 10, 9, 11, 8
};
#elif defined(OPENITHM_FULL2_0_SIDE)
static const int sensorMap[] = {
0, 3, 2, 1, 5, 6, 4, 7,
24, 27, 26, 25, 29, 30, 28, 31,
16, 19, 18, 17, 21, 22, 20, 23,
8, 11, 10, 9, 13, 14, 12, 15
};
#else
static const int sensorMap[] = {

11, 3, 10, 2, 9, 1, 8, 0,
31, 23, 30, 22, 29, 21, 28, 20,
27, 19, 26, 18, 25, 17, 24, 16,
15, 7, 14, 6, 13, 5, 12, 4
};
#endif
#endif
Expand Down
17 changes: 7 additions & 10 deletions Firmware/OpeNITHM/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
// #define OPENITHM_V1_1 // Version 1.1 (v1.1 on board under logo)
// #define OPENITHM_V2_0 // Version 2.0 (v2.0 in upper left of board)
// #define OPENITHM_V2_1 // Version 2.1 (v2.1 in upper left of board)
// #define OPENITHM_FULL_V1_0 // Version 1.0 of the fully integrated board with touch sensors (Not common)
#define OPENITHM_FULL_V2_0 // Version 2.0 of the fully integrated board with touch sensors (Integrated USB C Port)
// #define OPENITHM_FULL_V1_0 // Version 1.0 of the fully integrated board with touch sensors (Not common, prototype)
// #define OPENITHM_FULL2_0_SIDE // Version 2.0 of the fully integrated board with touch sensors (Uses extra LED board, FULL2.0_SIDE under logo)
// #define OPENITHM_FULL2_0_UP // Version 2.0 of the fully integrated board with touch sensors (RGB chips on the main board, FULL2.0_UP under logo)

// Uncomment this line if your IR sensors will be used in analog mode
// ** OPENITHM_V1_1 AND ABOVE SHOULD ENABLE THIS OPTION **
Expand Down Expand Up @@ -73,24 +74,20 @@
#define USB

// Spit out errors for board definitions
#if (defined(OPENITHM_V1_0) + defined(OPENITHM_V1_1) + defined(OPENITHM_V2_0) + defined(OPENITHM_V2_1) + defined(OPENITHM_FULL_V1_0) + defined(OPENITHM_FULL_V2_0)) == 0
#if (defined(OPENITHM_V1_0) + defined(OPENITHM_V1_1) + defined(OPENITHM_V2_0) + defined(OPENITHM_V2_1) + defined(OPENITHM_FULL_V1_0) + defined(OPENITHM_FULL2_0_SIDE) + defined(OPENITHM_FULL2_0_UP)) == 0
#error "Must define ONE Teensy board in Config.h"
#elif (defined(OPENITHM_V1_0) + defined(OPENITHM_V1_1) + defined(OPENITHM_V2_0) + defined(OPENITHM_V2_1) + defined(OPENITHM_FULL_V1_0) + defined(OPENITHM_FULL_V2_0)) > 1
#elif (defined(OPENITHM_V1_0) + defined(OPENITHM_V1_1) + defined(OPENITHM_V2_0) + defined(OPENITHM_V2_1) + defined(OPENITHM_FULL_V1_0) + defined(OPENITHM_FULL2_0_SIDE) + defined(OPENITHM_FULL2_0_UP)) > 1
#error "Cannot define multiple Teensy boards in Config.h"
#endif
#endif

#if (defined(OPENITHM_V2_0) || defined(OPENITHM_V2_1) || defined(OPENITHM_FULL_V1_0) || defined(OPENITHM_FULL_V2_0))
#if (defined(OPENITHM_V2_0) || defined(OPENITHM_V2_1) || defined(OPENITHM_FULL_V1_0) || defined(OPENITHM_FULL2_0_SIDE) || defined(OPENITHM_FULL2_0_UP))
#define NUM_SENSORS 32
#else
#define NUM_SENSORS 16
#endif

#if (defined(OPENITHM_FULL_V1_0) || defined(OPENITHM_FULL_V2_0))
#define ALT_TOUCHKEY_ORDER
#endif

#if defined(OPENITHM_FULL_V2_0)
#if (defined(OPENITHM_FULL2_0_SIDE) || defined(OPENITHM_FULL2_0_UP))
#define ALTERNATING_AIR
#endif

Expand Down
10 changes: 5 additions & 5 deletions Firmware/OpeNITHM/PinConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define MUX_0 4
#define MUX_1 3
#define MUX_2 2
#elif defined(OPENITHM_FULL_V2_0)
#elif defined(OPENITHM_FULL2_0_SIDE) || defined(OPENITHM_FULL2_0_UP)
#define MUX_0 7
#define MUX_1 6
#define MUX_2 2
Expand All @@ -43,7 +43,7 @@
#define LED_0 8
#define LED_1 7
#define LED_2 6
#elif defined(OPENITHM_FULL_V2_0)
#elif defined(OPENITHM_FULL2_0_SIDE) || defined(OPENITHM_FULL2_0_UP)
#define LED_0 14
#define LED_1 13
#define LED_2 15
Expand Down Expand Up @@ -76,7 +76,7 @@
#define AIR_SENSOR_3_PIN 19
#define AIR_SENSOR_4_PIN 21
#define AIR_SENSOR_5_PIN 23
#elif defined(OPENITHM_FULL_V2_0)
#elif defined(OPENITHM_FULL2_0_SIDE) || defined(OPENITHM_FULL2_0_UP)
#define AIR_SENSOR_0_PIN 18
#define AIR_SENSOR_1_PIN 23
#define AIR_SENSOR_2_PIN 19
Expand Down Expand Up @@ -108,7 +108,7 @@
#define TOUCH_1 15
#define TOUCH_2 16
#define TOUCH_3 0
#elif defined(OPENITHM_FULL_V2_0)
#elif defined(OPENITHM_FULL2_0_SIDE) || defined(OPENITHM_FULL2_0_UP)
#define TOUCH_0 0
#define TOUCH_1 4
#define TOUCH_2 3
Expand All @@ -132,7 +132,7 @@
#else
#define RGBPIN 11
#endif
#elif defined(OPENITHM_V2_1) || defined(OPENITHM_FULL_V1_0) || defined(OPENITHM_FULL_V2_0)
#elif defined(OPENITHM_V2_1) || defined(OPENITHM_FULL_V1_0) || defined(OPENITHM_FULL2_0_SIDE) || defined(OPENITHM_FULL2_0_UP)
#define RGBPIN 5
#endif

Expand Down