mirror of
https://github.com/Architeuthis-Flux/Jumperless.git
synced 2024-11-23 23:00:57 +01:00
machine-mode: getsupplyswitch
Example:
SEND ::getsupplyswitch:1395[]
REVC ::supplyswitch[5V]
REVC :🆗1395
This commit is contained in:
parent
e4f1517214
commit
8c425c441c
@ -22,7 +22,7 @@ ArduinoJson::DynamicJsonDocument machineModeJson(8000);
|
||||
|
||||
enum machineModeInstruction lastReceivedInstruction = unknown;
|
||||
|
||||
char machineModeInstructionString[NUMBEROFINSTRUCTIONS][20] = {"unknown", "netlist", "getnetlist", "bridgelist", "getbridgelist", "lightnode", "lightnet", "getmeasurement", "gpio", "uart", "arduinoflash", "setnetcolor", "setnodecolor", "setsupplyswitch"};
|
||||
char machineModeInstructionString[NUMBEROFINSTRUCTIONS][20] = {"unknown", "netlist", "getnetlist", "bridgelist", "getbridgelist", "lightnode", "lightnet", "getmeasurement", "gpio", "uart", "arduinoflash", "setnetcolor", "setnodecolor", "setsupplyswitch", "getsupplyswitch"};
|
||||
|
||||
enum machineModeInstruction parseMachineInstructions(int *sequenceNumber)
|
||||
{
|
||||
@ -495,6 +495,12 @@ void lightUpNodesFromInputBuffer(void)
|
||||
}
|
||||
}
|
||||
|
||||
void printSupplySwitch(int supplySwitchPos) {
|
||||
const char *positionString[] = { "3.3V", "5V", "8V" };
|
||||
Serial.print("::supplyswitch[");
|
||||
Serial.print(positionString[supplySwitchPos]);
|
||||
Serial.println("]");
|
||||
}
|
||||
|
||||
int setSupplySwitch(void)
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MACHINECOMMANDS_H
|
||||
#define MACHINECOMMANDS_H
|
||||
|
||||
#define NUMBEROFINSTRUCTIONS 15
|
||||
#define NUMBEROFINSTRUCTIONS 16
|
||||
|
||||
enum machineModeInstruction
|
||||
{
|
||||
@ -18,7 +18,8 @@ enum machineModeInstruction
|
||||
arduinoflash,
|
||||
setnetcolor,
|
||||
setnodecolor,
|
||||
setsupplyswitch
|
||||
setsupplyswitch,
|
||||
getsupplyswitch
|
||||
};
|
||||
|
||||
extern char inputBuffer[INPUTBUFFERLENGTH];
|
||||
@ -39,6 +40,7 @@ void lightUpNodesFromInputBuffer(void);
|
||||
|
||||
void lightUpNetsFromInputBuffer(void);
|
||||
|
||||
void printSupplySwitch(int supplySwitchPos);
|
||||
int setSupplySwitch(void);
|
||||
|
||||
void listNetsMachine(void);
|
||||
|
@ -543,6 +543,10 @@ void machineMode(void) // read in commands in machine readable format
|
||||
showLEDsCore2 = 1;
|
||||
break;
|
||||
|
||||
case getsupplyswitch:
|
||||
printSupplySwitch(supplySwitchPosition);
|
||||
break;
|
||||
|
||||
// case gpio:
|
||||
// break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user