Skip to content

Commit a1d41ea

Browse files
committed
Rename connectors INx_My to My_INx
This groups values my the motor connector that they are associated with
1 parent c54888b commit a1d41ea

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

Teknic

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ compiler.objcopy.eep.extra_flags=
5252
compiler.elf2hex.extra_flags=
5353

5454
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS.path}/CMSIS/Include/" "-I{build.variant.path}/Third Party/SAME53/CMSIS/Device/Include"
55-
compiler.arm.cmsis.ldflags="-L{runtime.platform.path}/Teknic/libClearCore/Debug" -lClearCore "-L{runtime.platform.path}/Teknic/LwIP/Debug" -lLwIP "-L{runtime.tools.CMSIS.path}/CMSIS/Lib/GCC/" -larm_cortexM4lf_math
55+
compiler.arm.cmsis.ldflags="-L{runtime.platform.path}/Teknic/libClearCore/Release" -lClearCore "-L{runtime.platform.path}/Teknic/LwIP/Release" -lLwIP "-L{runtime.tools.CMSIS.path}/CMSIS/Lib/GCC/" -larm_cortexM4lf_math
5656

5757
# Compile patterns
5858
# --------------------

variants/clearcore/pins_arduino.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@
4545
#define M2 CLEARCORE_PIN_M2
4646
#define M3 CLEARCORE_PIN_M3
4747

48-
#define M0INA CLEARCORE_PIN_INA_M0
49-
#define M0INB CLEARCORE_PIN_INB_M0
50-
#define M1INA CLEARCORE_PIN_INA_M1
51-
#define M1INB CLEARCORE_PIN_INB_M1
52-
#define M2INA CLEARCORE_PIN_INA_M2
53-
#define M2INB CLEARCORE_PIN_INB_M2
54-
#define M3INA CLEARCORE_PIN_INA_M3
55-
#define M3INB CLEARCORE_PIN_INB_M3
48+
#define M0_INA CLEARCORE_PIN_M0_INA
49+
#define M0_INB CLEARCORE_PIN_M0_INB
50+
#define M1_INA CLEARCORE_PIN_M1_INA
51+
#define M1_INB CLEARCORE_PIN_M1_INB
52+
#define M2_INA CLEARCORE_PIN_M2_INA
53+
#define M2_INB CLEARCORE_PIN_M2_INB
54+
#define M3_INA CLEARCORE_PIN_M3_INA
55+
#define M3_INB CLEARCORE_PIN_M3_INB
5656

5757
// CCIO-8 pin names
5858
#define CCIOA0 CLEARCORE_PIN_CCIOA0

variants/clearcore/variant.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ static inline uint32_t mapResolution(uint32_t value,
6767

6868
PinStatus digitalReadClearCore(pin_size_t conNum) {
6969
// check if trying to read a motor input
70-
if (conNum > CLEARCORE_PIN_MAX && conNum <= INBM3) {
70+
if (conNum > CLEARCORE_PIN_MAX && conNum <= M3_INB) {
7171
int motorPin = -1;
7272
switch (conNum) {
73-
case INAM0:
74-
case INBM0:
73+
case M0_INA:
74+
case M0_INB:
7575
motorPin = M0;
7676
break;
77-
case INAM1:
78-
case INBM1:
77+
case M1_INA:
78+
case M1_INB:
7979
motorPin = M1;
8080
break;
81-
case INAM2:
82-
case INBM2:
81+
case M2_INA:
82+
case M2_INB:
8383
motorPin = M2;
8484
break;
85-
case INAM3:
86-
case INBM3:
85+
case M3_INA:
86+
case M3_INB:
8787
motorPin = M3;
8888
break;
8989
}
@@ -94,7 +94,7 @@ PinStatus digitalReadClearCore(pin_size_t conNum) {
9494
ClearCore::SysMgr.ConnectorByIndex(
9595
static_cast<ClearCorePins>(motorPin)));
9696

97-
if (conNum > CLEARCORE_PIN_MAX && conNum < INBM0) {
97+
if (conNum > CLEARCORE_PIN_MAX && conNum < M0_INB) {
9898
return motor->MotorInAState() ? LOW : HIGH;
9999
}
100100
else {
@@ -121,23 +121,23 @@ PinStatus digitalReadClearCore(pin_size_t conNum) {
121121

122122
void digitalWriteClearCore(pin_size_t conNum, PinStatus ulVal) {
123123
// check if trying to write to a motor input
124-
if (conNum > CLEARCORE_PIN_MAX && conNum <= INBM3) {
124+
if (conNum > CLEARCORE_PIN_MAX && conNum <= M3_INB) {
125125
int motorPin = -1;
126126
switch (conNum) {
127-
case INAM0:
128-
case INBM0:
127+
case M0_INA:
128+
case M0_INB:
129129
motorPin = M0;
130130
break;
131-
case INAM1:
132-
case INBM1:
131+
case M1_INA:
132+
case M1_INB:
133133
motorPin = M1;
134134
break;
135-
case INAM2:
136-
case INBM2:
135+
case M2_INA:
136+
case M2_INB:
137137
motorPin = M2;
138138
break;
139-
case INAM3:
140-
case INBM3:
139+
case M3_INA:
140+
case M3_INB:
141141
motorPin = M3;
142142
break;
143143
}
@@ -148,7 +148,7 @@ void digitalWriteClearCore(pin_size_t conNum, PinStatus ulVal) {
148148
ClearCore::SysMgr.ConnectorByIndex(
149149
static_cast<ClearCorePins>(motorPin)));
150150

151-
if (conNum > CLEARCORE_PIN_MAX && conNum < INBM0) {
151+
if (conNum > CLEARCORE_PIN_MAX && conNum < M0_INB) {
152152
motor->MotorInAState(ulVal);
153153
}
154154
else {

0 commit comments

Comments
 (0)