Skip to content

Commit

Permalink
Probing mode improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Architeuthis-Flux committed Feb 14, 2024
1 parent 2a27492 commit 7ad7f2c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
21 changes: 13 additions & 8 deletions JumperlessNano/src/CH446Q.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,16 @@ int scanRows(int pin, bool clearLastFound)

if (gp18read == probe)
{
return -18;
delayMicroseconds(1000);
if (readFloatingOrState(18, -1) == probe)
{
return -18;
}

}

pinMode(19, INPUT);
delayMicroseconds(400);
delayMicroseconds(900);
int probeRead = readFloatingOrState(19, -1);

if (probeRead == high && ((lastFound[0] != SUPPLY_3V3 )))
Expand Down Expand Up @@ -561,12 +566,12 @@ int scanRows(int pin, bool clearLastFound)

if (justCleared && found != -1)
{
Serial.print("\n\rjustCleared: ");
Serial.println(justCleared);
Serial.print("nextIsSupply: ");
Serial.println(nextIsSupply);
Serial.print("nextIsGnd: ");
Serial.println(nextIsGnd);
// Serial.print("\n\rjustCleared: ");
// Serial.println(justCleared);
// Serial.print("nextIsSupply: ");
// Serial.println(nextIsSupply);
// Serial.print("nextIsGnd: ");
// Serial.println(nextIsGnd);

justCleared = 0;
}
Expand Down
15 changes: 10 additions & 5 deletions JumperlessNano/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ int baudRate = 115200;
unsigned long probingTimer = 0;
int restoredNodeFile = 0;

const char firmwareVersion[] = "1.3.0"; //// remember to update this
const char firmwareVersion[] = "1.3.1"; //// remember to update this

void loop()
{
Expand Down Expand Up @@ -183,15 +183,19 @@ void loop()
// //clearNodeFile();
// goto skipinput;
// }
if (millis() % 100 == 0)
if (millis() % 300 == 0)
{
startProbe();
if (readFloatingOrState(18) == 3)
{
delayMicroseconds(1000);
if (readFloatingOrState(18) == 3)
{
input = 'p';
probingTimer = millis();
// delay(500);
goto skipinput;
}
}
pinMode(19, INPUT);
}
Expand Down Expand Up @@ -277,14 +281,15 @@ void loop()
int row = 0;
while (Serial.available() == 0)
{
delayMicroseconds(9700);
delayMicroseconds(1700);
row = scanRows(0);

if (row != -1)
{
if (row == -18 && millis() - probingTimer > 800)
if (row == -18 && millis() - probingTimer > 500)
{
Serial.print("\n\rCommitting paths!\n\r");
probingTimer = millis();
break;
}
else if (row == -18)
Expand Down Expand Up @@ -392,7 +397,7 @@ void loop()
// Serial.print("bridgesToPaths\n\r");
delay(18);
// showNets();
rawOtherColors[1] = 0x550008;
rawOtherColors[1] = 0x350004;
sendAllPathsCore2 = 1;
delay(25);
pinMode(19, INPUT);
Expand Down

0 comments on commit 7ad7f2c

Please sign in to comment.