mirror of
https://github.com/Architeuthis-Flux/Jumperless.git
synced 2024-11-12 01:30:50 +01:00
add canonical defines and an option to print the long or short versions
This commit is contained in:
parent
5b7dd6fbe6
commit
64defcaf22
@ -379,7 +379,7 @@ void changeWokwiDefinesToJumperless(void)
|
||||
}
|
||||
else if (connString1.startsWith("pot1:"))
|
||||
{
|
||||
nodeNumber = DAC0_5V;
|
||||
nodeNumber = DAC0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -590,6 +590,8 @@ void replaceSFNamesWithDefinedInts(void)
|
||||
specialFunctionsString.replace("I_P", "108");
|
||||
specialFunctionsString.replace("CURRENT_SENSE_MINUS", "109");
|
||||
specialFunctionsString.replace("CURRENT_SENSE_PLUS", "108");
|
||||
specialFunctionsString.replace("ISENSE_MINUS", "109");
|
||||
specialFunctionsString.replace("IENSE_PLUS", "108");
|
||||
|
||||
specialFunctionsString.replace("EMPTY_NET", "127");
|
||||
|
||||
|
@ -191,21 +191,71 @@
|
||||
#define SUPPLY_3V3 103
|
||||
#define SUPPLY_5V 105
|
||||
|
||||
#define DAC0_5V 106
|
||||
#define DAC1_8V 107
|
||||
#define DAC0 106
|
||||
#define DAC1 107
|
||||
|
||||
#define CURRENT_SENSE_PLUS 108
|
||||
#define CURRENT_SENSE_MINUS 109
|
||||
#define ISENSE_PLUS 108
|
||||
#define ISENSE_MINUS 109
|
||||
|
||||
#define ADC0_5V 110
|
||||
#define ADC1_5V 111
|
||||
#define ADC2_5V 112
|
||||
#define ADC3_8V 113
|
||||
#define ADC0 110
|
||||
#define ADC1 111
|
||||
#define ADC2 112
|
||||
#define ADC3 113
|
||||
|
||||
#define RP_GPIO_0 114
|
||||
#define RP_UART_TX 116
|
||||
#define RP_UART_RX 117
|
||||
|
||||
#define RP_UART_TX 116 //also GPIO_16
|
||||
#define RP_GPIO_16 116 //these are the same as the UART pins
|
||||
|
||||
#define RP_UART_RX 117 //also GPIO_17
|
||||
#define RP_GPIO_17 117 //but if we want to use them as GPIO we should use these names
|
||||
|
||||
|
||||
|
||||
#define RP_GPIO_18 118 //these aren't actually connected to anything
|
||||
#define RP_GPIO_19 119 //but we might as well define names for them
|
||||
|
||||
#define SUPPLY_8V_P 120 //not actually connected to anything
|
||||
#define SUPPLY_8V_N 121 //not actually connected to anything
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
#define GND 100
|
||||
#define 3V3 103
|
||||
#define 5V 105
|
||||
|
||||
#define 8V 120
|
||||
|
||||
#define DAC0 106
|
||||
#define DAC1 107
|
||||
|
||||
#define I_P 108
|
||||
#define I_N 109
|
||||
|
||||
#define ADC0 110
|
||||
#define ADC1 111
|
||||
#define ADC2 112
|
||||
#define ADC3 113
|
||||
|
||||
#define GPIO_0 114
|
||||
|
||||
#define UART_TX 116
|
||||
#define GPIO_16 116 //these are the same as the UART pins
|
||||
|
||||
#define UART_RX 117
|
||||
#define GPIO_17 117 //but if we want to use them as GPIO we should use these names
|
||||
|
||||
|
||||
#define GPIO_18 118 //these aren't actually connected to anything
|
||||
#define GPIO_19 119 //but we might as well define names for them
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#define EMPTY_NET 127
|
||||
|
||||
|
@ -750,7 +750,7 @@ void listNetsMachine(void)
|
||||
{
|
||||
Serial.print(';');
|
||||
}
|
||||
printNodeOrName(n->nodes[j]);
|
||||
printNodeOrName(n->nodes[j], 1);
|
||||
}
|
||||
Serial.print(',');
|
||||
|
||||
@ -803,9 +803,9 @@ void listBridgesMachine(void)
|
||||
{
|
||||
started = true;
|
||||
}
|
||||
printNodeOrName(n->bridges[j][0]);
|
||||
printNodeOrName(n->bridges[j][0],1);
|
||||
Serial.print("-");
|
||||
printNodeOrName(n->bridges[j][1]);
|
||||
printNodeOrName(n->bridges[j][1],1);
|
||||
}
|
||||
}
|
||||
Serial.println("]");
|
||||
|
@ -9,15 +9,15 @@
|
||||
|
||||
|
||||
struct netStruct net[MAX_NETS] = { //these are the special function nets that will always be made
|
||||
//netNumber, ,netName ,memberNodes[] ,memberBridges[][2] ,specialFunction ,intsctNet[] ,doNotIntersectNodes[] ,priority
|
||||
//netNumber, ,netName ,memberNodes[] ,memberBridges[][2] ,specialFunction ,intsctNet[] ,doNotIntersectNodes[] ,priority (unused)
|
||||
{ 127 ,"Empty Net" ,{EMPTY_NET} ,{{}} ,EMPTY_NET ,{} ,{EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET} , 0},
|
||||
{ 1 ,"GND" ,{GND} ,{{}} ,GND ,{} ,{SUPPLY_3V3,SUPPLY_5V,DAC0_5V,DAC1_8V} , 1},
|
||||
{ 2 ,"+5V" ,{SUPPLY_5V} ,{{}} ,SUPPLY_5V ,{} ,{GND,SUPPLY_3V3,DAC0_5V,DAC1_8V} , 1},
|
||||
{ 3 ,"+3.3V" ,{SUPPLY_3V3} ,{{}} ,SUPPLY_3V3 ,{} ,{GND,SUPPLY_5V,DAC0_5V,DAC1_8V} , 1},
|
||||
{ 4 ,"DAC 0" ,{DAC0_5V} ,{{}} ,DAC0_5V ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC1_8V} , 1},
|
||||
{ 5 ,"DAC 1" ,{DAC1_8V} ,{{}} ,DAC1_8V ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC0_5V} , 1},
|
||||
{ 6 ,"I Sense +" ,{CURRENT_SENSE_PLUS} ,{{}} ,CURRENT_SENSE_PLUS ,{} ,{CURRENT_SENSE_MINUS} , 2},
|
||||
{ 7 ,"I Sense -" ,{CURRENT_SENSE_MINUS} ,{{}} ,CURRENT_SENSE_MINUS ,{} ,{CURRENT_SENSE_PLUS} , 2},
|
||||
{ 1 ,"GND" ,{GND} ,{{}} ,GND ,{} ,{SUPPLY_3V3,SUPPLY_5V,DAC0,DAC1} , 1},
|
||||
{ 2 ,"+5V" ,{SUPPLY_5V} ,{{}} ,SUPPLY_5V ,{} ,{GND,SUPPLY_3V3,DAC0,DAC1} , 1},
|
||||
{ 3 ,"+3.3V" ,{SUPPLY_3V3} ,{{}} ,SUPPLY_3V3 ,{} ,{GND,SUPPLY_5V,DAC0,DAC1} , 1},
|
||||
{ 4 ,"DAC 0" ,{DAC0} ,{{}} ,DAC0 ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC1} , 1},
|
||||
{ 5 ,"DAC 1" ,{DAC1} ,{{}} ,DAC1 ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC0} , 1},
|
||||
{ 6 ,"I Sense +" ,{ISENSE_PLUS} ,{{}} ,ISENSE_PLUS ,{} ,{ISENSE_MINUS} , 2},
|
||||
{ 7 ,"I Sense -" ,{ISENSE_MINUS} ,{{}} ,ISENSE_MINUS ,{} ,{ISENSE_PLUS} , 2},
|
||||
};
|
||||
|
||||
char *netNameConstants[MAX_NETS] = {(char*)"Net 0",(char*)"Net 1",(char*)"Net 2",(char*)"Net 3",(char*)"Net 4",(char*)"Net 5",(char*)"Net 6",(char*)"Net 7",(char*)"Net 8",(char*)"Net 9",(char*)"Net 10",(char*)"Net 11",(char*)"Net 12",(char*)"Net 13",(char*)"Net 14",(char*)"Net 15",(char*)"Net 16",(char*)"Net 17",(char*)"Net 18",(char*)"Net 19",(char*)"Net 20",(char*)"Net 21",(char*)"Net 22",(char*)"Net 23",(char*)"Net 24",(char*)"Net 25",(char*)"Net 26",(char*)"Net 27",(char*)"Net 28",(char*)"Net 29",(char*)"Net 30",(char*)"Net 31",(char*)"Net 32",(char*)"Net 33",(char*)"Net 34",(char*)"Net 35",(char*)"Net 36",(char*)"Net 37",(char*)"Net 38",(char*)"Net 39",(char*)"Net 40",(char*)"Net 41",(char*)"Net 42",(char*)"Net 43",(char*)"Net 44",(char*)"Net 45",(char*)"Net 46",(char*)"Net 47",(char*)"Net 48",(char*)"Net 49",(char*)"Net 50",(char*)"Net 51",(char*)"Net 52",(char*)"Net 53",(char*)"Net 54",(char*)"Net 55",(char*)"Net 56",(char*)"Net 57",(char*)"Net 58",(char*)"Net 59",(char*)"Net 60",(char*)"Net 61",(char*)"Net 62"};//,{"Net 63",(char*)"Net 64",(char*)"Net 65",(char*)"Net 66",(char*)"Net 67",(char*)"Net 68",(char*)"Net 69",(char*)"Net 70",(char*)"Net 71",(char*)"Net 72",(char*)"Net 73",(char*)"Net 74",(char*)"Net 75",(char*)"Net 76",(char*)"Net 77",(char*)"Net 78",(char*)"Net 79",(char*)"Net 80",(char*)"Net 81",(char*)"Net 82",(char*)"Net 83",(char*)"Net 84",(char*)"Net 85",(char*)"Net 86",(char*)"Net 87",(char*)"Net 88",(char*)"Net 89",(char*)"Net 90",(char*)"Net 91",(char*)"Net 92",(char*)"Net 93",(char*)"Net 94",(char*)"Net 95",(char*)"Net 96",(char*)"Net 97",(char*)"Net 98",(char*)"Net 99",(char*)"Net 100",(char*)"Net 101",(char*)"Net 102",(char*)"Net 103",(char*)"Net 104",(char*)"Net 105",(char*)"Net 106",(char*)"Net 107",(char*)"Net 108",(char*)"Net 109",(char*)"Net 110",(char*)"Net 111",(char*)"Net 112",(char*)"Net 113",(char*)"Net 114",(char*)"Net 115",(char*)"Net 116",(char*)"Net 117",(char*)"Net 118",(char*)"Net 119",(char*)"Net 120",(char*)"Net 121",(char*)"Net 122",(char*)"Net 123",(char*)"Net 124",(char*)"Net 125",(char*)"Net 126",(char*)"Net 127"}};
|
||||
@ -96,25 +96,25 @@ struct chipStatus ch[12] = {
|
||||
{8,'I',
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, // x status
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1}, //y status
|
||||
{NANO_A0, NANO_D1, NANO_A2, NANO_D3, NANO_A4, NANO_D5, NANO_A6, NANO_D7, NANO_D11, NANO_D9, NANO_D13, NANO_RESET, DAC0_5V, ADC0_5V, SUPPLY_3V3, GND},
|
||||
{NANO_A0, NANO_D1, NANO_A2, NANO_D3, NANO_A4, NANO_D5, NANO_A6, NANO_D7, NANO_D11, NANO_D9, NANO_D13, NANO_RESET, DAC0, ADC0, SUPPLY_3V3, GND},
|
||||
{CHIP_A,CHIP_B,CHIP_C,CHIP_D,CHIP_E,CHIP_F,CHIP_G,CHIP_H}},
|
||||
|
||||
{9,'J',
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, // x status
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1}, //y status
|
||||
{NANO_D0, NANO_A1, NANO_D2, NANO_A3, NANO_D4, NANO_A5, NANO_D6, NANO_A7, NANO_D8, NANO_D10, NANO_D12, NANO_AREF, DAC1_8V, ADC1_5V, SUPPLY_5V, GND},
|
||||
{NANO_D0, NANO_A1, NANO_D2, NANO_A3, NANO_D4, NANO_A5, NANO_D6, NANO_A7, NANO_D8, NANO_D10, NANO_D12, NANO_AREF, DAC1, ADC1, SUPPLY_5V, GND},
|
||||
{CHIP_A,CHIP_B,CHIP_C,CHIP_D,CHIP_E,CHIP_F,CHIP_G,CHIP_H}},
|
||||
|
||||
{10,'K',
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, // x status
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1}, //y status
|
||||
{NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, ADC2_5V},
|
||||
{NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, ADC2},
|
||||
{CHIP_A,CHIP_B,CHIP_C,CHIP_D,CHIP_E,CHIP_F,CHIP_G,CHIP_H}},
|
||||
|
||||
{11,'L',
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, // x status
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1}, //y status
|
||||
{CURRENT_SENSE_MINUS, CURRENT_SENSE_PLUS, ADC0_5V, ADC1_5V, ADC2_5V, ADC3_8V, DAC1_8V, DAC0_5V, TOP_1, TOP_30, BOTTOM_1, BOTTOM_30, RP_UART_TX, RP_UART_RX, SUPPLY_5V, RP_GPIO_0},
|
||||
{ISENSE_MINUS, ISENSE_PLUS, ADC0, ADC1, ADC2, ADC3, DAC1, DAC0, TOP_1, TOP_30, BOTTOM_1, BOTTOM_30, RP_UART_TX, RP_UART_RX, SUPPLY_5V, RP_GPIO_0},
|
||||
{CHIP_A,CHIP_B,CHIP_C,CHIP_D,CHIP_E,CHIP_F,CHIP_G,CHIP_H}}
|
||||
};
|
||||
|
||||
@ -151,7 +151,7 @@ struct nanoStatus nano = { //there's only one of these so ill declare and inita
|
||||
// xMapIJKL[] will tell you the X pin that it's connected to on that sf chip
|
||||
// xStatusIJKL[] says whether that x pin is being used (this should be the same as mt[8-10].xMap[] if theyre all stacked on top of each other)
|
||||
// I haven't decided whether to make this just a flag, or store that signal's destination
|
||||
{NANO_D0, NANO_D1, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, NANO_D13, NANO_RESET, NANO_AREF, NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_A4, NANO_A5, NANO_A6, NANO_A7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,GND,101,102,SUPPLY_3V3,104,SUPPLY_5V,DAC0_5V,DAC1_8V,CURRENT_SENSE_PLUS,CURRENT_SENSE_MINUS}
|
||||
{NANO_D0, NANO_D1, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, NANO_D13, NANO_RESET, NANO_AREF, NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_A4, NANO_A5, NANO_A6, NANO_A7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,GND,101,102,SUPPLY_3V3,104,SUPPLY_5V,DAC0,DAC1,ISENSE_PLUS,ISENSE_MINUS}
|
||||
|
||||
};
|
||||
|
||||
@ -172,6 +172,8 @@ struct pathStruct path[MAX_BRIDGES]; // node1, node2, net, chip[3], x[3], y[3]
|
||||
{"INA_P", 108},
|
||||
{"I_N", 109},
|
||||
{"I_P", 108},
|
||||
{"ISENSE_MINUS", 109},
|
||||
{"ISENSE_PLUS", 108},
|
||||
{"CURRENT_SENSE_MINUS", 109},
|
||||
{"CURRENT_SENSE_PLUS", 108},
|
||||
{"EMPTY_NET", 127},
|
||||
@ -275,7 +277,7 @@ int8_t xMapL[24] = { -1 , -1 , -1 , -1 , -1 , -1 , -1
|
||||
// xMapIJKL[] will tell you the X pin that it's connected to on that sf chip
|
||||
// xStatusIJKL[] says whether that x pin is being used (this should be the same as mt[8-10].xMap[] if theyre all stacked on top of each other)
|
||||
// I haven't decided whether to make this just a flag, or store that signal's destination
|
||||
const int8_t reversePinMap[110] = {NANO_D0, NANO_D1, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, NANO_D13, NANO_RESET, NANO_AREF, NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_A4, NANO_A5, NANO_A6, NANO_A7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,GND,101,102,SUPPLY_3V3,104,SUPPLY_5V,DAC0_5V,DAC1_8V,CURRENT_SENSE_PLUS,CURRENT_SENSE_MINUS};
|
||||
const int8_t reversePinMap[110] = {NANO_D0, NANO_D1, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, NANO_D13, NANO_RESET, NANO_AREF, NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_A4, NANO_A5, NANO_A6, NANO_A7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,GND,101,102,SUPPLY_3V3,104,SUPPLY_5V,DAC0,DAC1_8V,ISENSE_PLUS,ISENSE_MINUS};
|
||||
|
||||
};
|
||||
|
||||
@ -362,10 +364,10 @@ const int8_t yConnectionMapG[8] = {-1, 47, 48, 49, 50, 51, 52, 53}; //
|
||||
const int8_t yConnectionMapH[8] = {-1, 54, 55, 56, 57, 58, 59, 60}; //
|
||||
|
||||
|
||||
const int8_t xConnectionMapI[16] = {NANO_A0, NANO_D1, NANO_A2, NANO_D3, NANO_A4, NANO_D5, NANO_A6, NANO_D7, NANO_D11, NANO_D9, NANO_D13, NANO_RESET, DAC0_5V, ADC0_5V, SUPPLY_3V3, GND};
|
||||
const int8_t xConnectionMapI[16] = {NANO_A0, NANO_D1, NANO_A2, NANO_D3, NANO_A4, NANO_D5, NANO_A6, NANO_D7, NANO_D11, NANO_D9, NANO_D13, NANO_RESET, DAC0, ADC0, SUPPLY_3V3, GND};
|
||||
const int8_t xConnectionMapJ[16] = {NANO_D0, NANO_A1, NANO_D2, NANO_A3, NANO_D4, NANO_A5, NANO_D6, NANO_A7, NANO_D8, NANO_D10, NANO_D12, NANO_AREF, DAC1_8V, ADC1_5V, SUPPLY_5V, GND};
|
||||
const int8_t xConnectionMapK[16] = {NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_A4, NANO_A5, NANO_A6, NANO_A7, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9};
|
||||
const int8_t xConnectionMapK[16] = {CURRENT_SENSE_MINUS, CURRENT_SENSE_PLUS, ADC0_5V, ADC1_5V, ADC2_5V, ADC3_8V, DAC1_8V, DAC0_5V, t1, t30, b1, b30, NANO_A4, NANO_A5, SUPPLY_5V, GND};
|
||||
const int8_t xConnectionMapK[16] = {ISENSE_MINUS, ISENSE_PLUS, ADC0, ADC1_5V, ADC2_5V, ADC3, DAC1_8V, DAC0, t1, t30, b1, b30, NANO_A4, NANO_A5, SUPPLY_5V, GND};
|
||||
|
||||
//nanoConnectionMap[0] is the list of pin numbers, [1] and [3] are which special function chips they're connected to, [2] and [4] is the X pin on that chip, -1 for none
|
||||
|
||||
|
@ -884,16 +884,16 @@ void printBridgeArray(void)
|
||||
Serial.print("ms to run net manager\n\r");
|
||||
}
|
||||
|
||||
int printNodeOrName(int node) // returns number of characters printed (for tabs)
|
||||
int printNodeOrName(int node, int longOrShort) // returns number of characters printed (for tabs)
|
||||
{
|
||||
|
||||
if (node >= 100)
|
||||
{
|
||||
return Serial.print(definesToChar(node));
|
||||
return Serial.print(definesToChar(node, longOrShort));
|
||||
}
|
||||
else if (node >= NANO_D0)
|
||||
{
|
||||
return Serial.print(definesToChar(node));
|
||||
return Serial.print(definesToChar(node, longOrShort));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -903,25 +903,48 @@ int printNodeOrName(int node) // returns number of characters printed (for tabs)
|
||||
|
||||
|
||||
char same[12] = " ";
|
||||
const char *definesToChar(int defined) // converts the internally used #defined numbers into human readable strings
|
||||
const char *definesToChar(int defined, int longOrShort) // converts the internally used #defined numbers into human readable strings
|
||||
{
|
||||
// Serial.print("defined = ");
|
||||
//Serial.println(defined);
|
||||
|
||||
const char *defNanoToChar[26] = {"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", "D13", "RESET", "AREF", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7"};
|
||||
|
||||
const char *defSpecialToChar[20] = {"GND", "NOT_DEFINED", "NOT_DEFINED", "3V3", "NOT_DEFINED", "5V", "DAC_0", "DAC_1", "I_POS", "I_NEG", "ADC_0" , "ADC_1" , "ADC_2" , "ADC_3", "GPIO_0", "NOT_DEFINED", "UART_Tx", "UART_Rx"};
|
||||
const char *defNanoToCharShort[26] = {"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", "D13", "RESET", "AREF", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7"};
|
||||
|
||||
const char *defSpecialToCharShort[20] = {"GND", "NOT_DEFINED", "NOT_DEFINED", "3V3", "NOT_DEFINED", "5V", "DAC_0", "DAC_1", "I_POS", "I_NEG", "ADC_0" , "ADC_1" , "ADC_2" , "ADC_3", "GPIO_0", "NOT_DEFINED", "UART_Tx", "UART_Rx", "GPIO_18", "GPIO_19"};
|
||||
|
||||
|
||||
const char *defNanoToCharLong[26] = {"NANO_D0", "NANO_D1", "NANO_D2", "NANO_D3", "NANO_D4", "NANO_D5", "NANO_D6", "NANO_D7", "NANO_D8", "NANO_D9", "NANO_D10", "NANO_D11", "NANO_D12", "NANO_D13", "NANO_RESET", "NANO_AREF", "NANO_A0", "NANO_A1", "NANO_A2", "NANO_A3", "NANO_A4", "NANO_A5", "NANO_A6", "NANO_A7"};
|
||||
|
||||
const char *defSpecialToCharLong[20] = {"GND", "NOT_DEFINED", "NOT_DEFINED", "SUPPLY_3V3", "NOT_DEFINED", "SUPPLY_5V", "DAC0", "DAC1", "ISENSE_PLUS", "ISENSE_MINUS", "ADC0" , "ADC1" , "ADC2" , "ADC3", "RP_GPIO_0", "NOT_DEFINED", "RP_UART_Tx", "RP_UART_Rx", "RP_GPIO_18", "RP_GPIO_19"};
|
||||
|
||||
|
||||
const char *emptyNet[] = {"EMPTY_NET", "?"};
|
||||
|
||||
if (defined >= 70 && defined <= 93)
|
||||
{
|
||||
return defNanoToChar[defined - 70];
|
||||
if (longOrShort == 1)
|
||||
{
|
||||
return defNanoToCharLong[defined - 70];
|
||||
}
|
||||
else
|
||||
{
|
||||
return defNanoToCharShort[defined - 70];
|
||||
}
|
||||
|
||||
}
|
||||
else if (defined >= 100 && defined <= RP_UART_RX)
|
||||
else if (defined >= 100 && defined <= RP_GPIO_19)
|
||||
{
|
||||
|
||||
return defSpecialToChar[defined - 100];
|
||||
if (longOrShort == 1)
|
||||
{
|
||||
return defSpecialToCharLong[defined - 100];
|
||||
}
|
||||
else
|
||||
{
|
||||
return defSpecialToCharShort[defined - 100];
|
||||
}
|
||||
|
||||
}
|
||||
else if (defined == EMPTY_NET)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ extern bool debugNMtime;
|
||||
|
||||
void writeJSONtoFile();
|
||||
|
||||
int printNodeOrName(int node);
|
||||
int printNodeOrName(int node, int longOrShort = 0); //0 = short, 1 = long
|
||||
|
||||
void getNodesToConnect(); //read in the nodes you'd like to connect
|
||||
|
||||
@ -50,7 +50,7 @@ void deleteBridge();
|
||||
|
||||
void deleteNode(); //disconnects everything connected to that one node
|
||||
|
||||
const char* definesToChar (int defined);
|
||||
const char* definesToChar (int defined, int longOrShort = 0); //0 = short, 1 = long
|
||||
|
||||
void printBridgeArray();
|
||||
|
||||
|
@ -100,23 +100,23 @@ void clearAllNTCC(void)
|
||||
}
|
||||
|
||||
net[0] = {127, "Empty Net", {EMPTY_NET}, {{}}, EMPTY_NET, {}, {EMPTY_NET, EMPTY_NET, EMPTY_NET, EMPTY_NET, EMPTY_NET, EMPTY_NET, EMPTY_NET}, 0, 0};
|
||||
net[1] = {1, "GND", {GND}, {{}}, GND, {}, {SUPPLY_3V3, SUPPLY_5V, DAC0_5V, DAC1_8V}, 1, 0};
|
||||
net[2] = {2, "+5V", {SUPPLY_5V}, {{}}, SUPPLY_5V, {}, {GND, SUPPLY_3V3, DAC0_5V, DAC1_8V}, 1, 0};
|
||||
net[3] = {3, "+3.3V", {SUPPLY_3V3}, {{}}, SUPPLY_3V3, {}, {GND, SUPPLY_5V, DAC0_5V, DAC1_8V}, 0};
|
||||
net[4] = {4, "DAC 0", {DAC0_5V}, {{}}, DAC0_5V, {}, {GND, SUPPLY_5V, SUPPLY_3V3, DAC1_8V}, 1, 0};
|
||||
net[1] = {1, "GND", {GND}, {{}}, GND, {}, {SUPPLY_3V3, SUPPLY_5V, DAC0, DAC1}, 1, 0};
|
||||
net[2] = {2, "+5V", {SUPPLY_5V}, {{}}, SUPPLY_5V, {}, {GND, SUPPLY_3V3, DAC0, DAC1}, 1, 0};
|
||||
net[3] = {3, "+3.3V", {SUPPLY_3V3}, {{}}, SUPPLY_3V3, {}, {GND, SUPPLY_5V, DAC0, DAC1}, 0};
|
||||
net[4] = {4, "DAC 0", {DAC0}, {{}}, DAC0, {}, {GND, SUPPLY_5V, SUPPLY_3V3, DAC1}, 1, 0};
|
||||
net[5] = {
|
||||
5,
|
||||
"DAC 1",
|
||||
{DAC1_8V},
|
||||
{DAC1},
|
||||
{{}},
|
||||
DAC1_8V,
|
||||
DAC1,
|
||||
{},
|
||||
{GND, SUPPLY_5V, SUPPLY_3V3, DAC0_5V},
|
||||
{GND, SUPPLY_5V, SUPPLY_3V3, DAC0},
|
||||
1,
|
||||
0,
|
||||
};
|
||||
net[6] = {6, "I Sense +", {CURRENT_SENSE_PLUS}, {{}}, CURRENT_SENSE_PLUS, {}, {CURRENT_SENSE_MINUS}, 2, 0};
|
||||
net[7] = {7, "I Sense -", {CURRENT_SENSE_MINUS}, {{}}, CURRENT_SENSE_MINUS, {}, {CURRENT_SENSE_PLUS}, 2, 0};
|
||||
net[6] = {6, "I Sense +", {ISENSE_PLUS}, {{}}, ISENSE_PLUS, {}, {ISENSE_MINUS}, 2, 0};
|
||||
net[7] = {7, "I Sense -", {ISENSE_MINUS}, {{}}, ISENSE_MINUS, {}, {ISENSE_PLUS}, 2, 0};
|
||||
|
||||
net[1].rawColor = rawSpecialNetColors[1];
|
||||
net[2].rawColor = rawSpecialNetColors[2];
|
||||
@ -1720,15 +1720,15 @@ void resolveAltPaths(void)
|
||||
|
||||
if (whichIsSF == 0)
|
||||
{
|
||||
path[i].x[whichIsSF] = xMapForNode(ADC0_5V + whichADC, sfChip1);
|
||||
path[i].x[whichIsSF] = xMapForNode(ADC0 + whichADC, sfChip1);
|
||||
ch[sfChip1].xStatus[path[i].x[whichIsSF]] = path[i].net;
|
||||
// path[i].x[whichIsL] = xMapForNode(ADC0_5V + whichADC, sfChip2);
|
||||
// path[i].x[whichIsL] = xMapForNode(ADC0 + whichADC, sfChip2);
|
||||
}
|
||||
else
|
||||
{
|
||||
path[i].x[whichIsSF] = xMapForNode(ADC0_5V + whichADC, sfChip2);
|
||||
path[i].x[whichIsSF] = xMapForNode(ADC0 + whichADC, sfChip2);
|
||||
ch[sfChip2].xStatus[path[i].x[whichIsSF]] = path[i].net;
|
||||
// path[i].x[whichIsL] = xMapForNode(ADC0_5V + whichADC, sfChip1);
|
||||
// path[i].x[whichIsL] = xMapForNode(ADC0 + whichADC, sfChip1);
|
||||
}
|
||||
|
||||
if (debugNTCC2)
|
||||
@ -3614,20 +3614,20 @@ const int8_t xMapL[24] = { -1 , -1 , -1 , -1 , -1 , -1
|
||||
// xMapIJKL[] will tell you the X pin that it's connected to on that sf chip
|
||||
// xStatusIJKL[] says whether that x pin is being used (this should be the same as mt[8-10].xMap[] if theyre all stacked on top of each other)
|
||||
// I haven't decided whether to make this just a flag, or store that signal's destination
|
||||
const int8_t reversePinMap[110] = {NANO_D0, NANO_D1, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, NANO_D13, NANO_RESET, NANO_AREF, NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_A4, NANO_A5, NANO_A6, NANO_A7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,GND,101,102,SUPPLY_3V3,104,SUPPLY_5V,DAC0_5V,DAC1_8V,CURRENT_SENSE_PLUS,CURRENT_SENSE_MINUS};
|
||||
const int8_t reversePinMap[110] = {NANO_D0, NANO_D1, NANO_D2, NANO_D3, NANO_D4, NANO_D5, NANO_D6, NANO_D7, NANO_D8, NANO_D9, NANO_D10, NANO_D11, NANO_D12, NANO_D13, NANO_RESET, NANO_AREF, NANO_A0, NANO_A1, NANO_A2, NANO_A3, NANO_A4, NANO_A5, NANO_A6, NANO_A7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,GND,101,102,SUPPLY_3V3,104,SUPPLY_5V,DAC0,DAC1_8V,ISENSE_PLUS,ISENSE_MINUS};
|
||||
|
||||
};
|
||||
|
||||
struct netStruct net[MAX_NETS] = { //these are the special function nets that will always be made
|
||||
//netNumber, ,netName ,memberNodes[] ,memberBridges[][2] ,specialFunction ,intsctNet[] ,doNotIntersectNodes[] ,priority
|
||||
{ 127 ,"Empty Net" ,{EMPTY_NET} ,{{}} ,EMPTY_NET ,{} ,{EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET,EMPTY_NET} , 0},
|
||||
{ 1 ,"GND\t" ,{GND} ,{{}} ,GND ,{} ,{SUPPLY_3V3,SUPPLY_5V,DAC0_5V,DAC1_8V} , 1},
|
||||
{ 2 ,"+5V\t" ,{SUPPLY_5V} ,{{}} ,SUPPLY_5V ,{} ,{GND,SUPPLY_3V3,DAC0_5V,DAC1_8V} , 1},
|
||||
{ 3 ,"+3.3V\t" ,{SUPPLY_3V3} ,{{}} ,SUPPLY_3V3 ,{} ,{GND,SUPPLY_5V,DAC0_5V,DAC1_8V} , 1},
|
||||
{ 4 ,"DAC 0\t" ,{DAC0_5V} ,{{}} ,DAC0_5V ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC1_8V} , 1},
|
||||
{ 5 ,"DAC 1\t" ,{DAC1_8V} ,{{}} ,DAC1_8V ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC0_5V} , 1},
|
||||
{ 6 ,"I Sense +" ,{CURRENT_SENSE_PLUS} ,{{}} ,CURRENT_SENSE_PLUS ,{} ,{CURRENT_SENSE_MINUS} , 2},
|
||||
{ 7 ,"I Sense -" ,{CURRENT_SENSE_MINUS} ,{{}} ,CURRENT_SENSE_MINUS ,{} ,{CURRENT_SENSE_PLUS} , 2},
|
||||
{ 1 ,"GND\t" ,{GND} ,{{}} ,GND ,{} ,{SUPPLY_3V3,SUPPLY_5V,DAC0,DAC1_8V} , 1},
|
||||
{ 2 ,"+5V\t" ,{SUPPLY_5V} ,{{}} ,SUPPLY_5V ,{} ,{GND,SUPPLY_3V3,DAC0,DAC1_8V} , 1},
|
||||
{ 3 ,"+3.3V\t" ,{SUPPLY_3V3} ,{{}} ,SUPPLY_3V3 ,{} ,{GND,SUPPLY_5V,DAC0,DAC1_8V} , 1},
|
||||
{ 4 ,"DAC 0\t" ,{DAC0} ,{{}} ,DAC0 ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC1_8V} , 1},
|
||||
{ 5 ,"DAC 1\t" ,{DAC1_8V} ,{{}} ,DAC1_8V ,{} ,{GND,SUPPLY_5V,SUPPLY_3V3,DAC0} , 1},
|
||||
{ 6 ,"I Sense +" ,{ISENSE_PLUS} ,{{}} ,ISENSE_PLUS ,{} ,{ISENSE_MINUS} , 2},
|
||||
{ 7 ,"I Sense -" ,{ISENSE_MINUS} ,{{}} ,ISENSE_MINUS ,{} ,{ISENSE_PLUS} , 2},
|
||||
};
|
||||
|
||||
|
||||
@ -3714,7 +3714,7 @@ struct chipStatus ch[12] = {
|
||||
{8,'I',
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, // x status
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1}, //y status
|
||||
{NANO_A0, NANO_D1, NANO_A2, NANO_D3, NANO_A4, NANO_D5, NANO_A6, NANO_D7, NANO_D11, NANO_D9, NANO_D13, NANO_RESET, DAC0_5V, ADC0_5V, SUPPLY_3V3, GND},
|
||||
{NANO_A0, NANO_D1, NANO_A2, NANO_D3, NANO_A4, NANO_D5, NANO_A6, NANO_D7, NANO_D11, NANO_D9, NANO_D13, NANO_RESET, DAC0, ADC0, SUPPLY_3V3, GND},
|
||||
{CHIP_A,CHIP_B,CHIP_C,CHIP_D,CHIP_E,CHIP_F,CHIP_G,CHIP_H}},
|
||||
|
||||
{9,'J',
|
||||
@ -3732,7 +3732,7 @@ struct chipStatus ch[12] = {
|
||||
{11,'L',
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, // x status
|
||||
{-1,-1,-1,-1,-1,-1,-1,-1}, //y status
|
||||
{CURRENT_SENSE_MINUS, CURRENT_SENSE_PLUS, ADC0_5V, ADC1_5V, ADC2_5V, ADC3_8V, DAC1_8V, DAC0_5V, t1, t30, b1, b30, NANO_A4, NANO_A5, SUPPLY_5V, GND},
|
||||
{ISENSE_MINUS, ISENSE_PLUS, ADC0, ADC1_5V, ADC2_5V, ADC3_8V, DAC1_8V, DAC0, t1, t30, b1, b30, NANO_A4, NANO_A5, SUPPLY_5V, GND},
|
||||
{CHIP_A,CHIP_B,CHIP_C,CHIP_D,CHIP_E,CHIP_F,CHIP_G,CHIP_H}}
|
||||
};
|
||||
|
||||
|
@ -296,27 +296,27 @@ void chooseShownReadings(void)
|
||||
for (int i = 0; i <= newBridgeIndex; i++)
|
||||
{
|
||||
|
||||
if (path[i].node1 == ADC0_5V || path[i].node2 == ADC0_5V)
|
||||
if (path[i].node1 == ADC0 || path[i].node2 == ADC0)
|
||||
{
|
||||
showADCreadings[0] = path[i].net;
|
||||
}
|
||||
|
||||
if (path[i].node1 == ADC1_5V || path[i].node2 == ADC1_5V)
|
||||
if (path[i].node1 == ADC1 || path[i].node2 == ADC1)
|
||||
{
|
||||
showADCreadings[1] = path[i].net;
|
||||
}
|
||||
|
||||
if (path[i].node1 == ADC2_5V || path[i].node2 == ADC2_5V)
|
||||
if (path[i].node1 == ADC2 || path[i].node2 == ADC2)
|
||||
{
|
||||
showADCreadings[2] = path[i].net;
|
||||
}
|
||||
|
||||
if (path[i].node1 == ADC3_8V || path[i].node2 == ADC3_8V)
|
||||
if (path[i].node1 == ADC3 || path[i].node2 == ADC3)
|
||||
{
|
||||
showADCreadings[3] = path[i].net;
|
||||
}
|
||||
|
||||
if (path[i].node1 == CURRENT_SENSE_PLUS || path[i].node1 == CURRENT_SENSE_PLUS || path[i].node2 == CURRENT_SENSE_MINUS || path[i].node2 == CURRENT_SENSE_MINUS)
|
||||
if (path[i].node1 == ISENSE_PLUS || path[i].node1 == ISENSE_PLUS || path[i].node2 == ISENSE_MINUS || path[i].node2 == ISENSE_MINUS)
|
||||
{
|
||||
//Serial.println(showReadings);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user