mirror of
https://github.com/Architeuthis-Flux/Jumperless.git
synced 2024-11-27 17:00:55 +01:00
Merge pull request #22 from nilclass/machine-command-getsupplyswitch
machine-mode: getsupplyswitch
This commit is contained in:
commit
f4dc793289
@ -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