Add reset-mcu with Props::resetMcu()
This commit is contained in:
Binary file not shown.
@@ -68,6 +68,10 @@ void InboxMessage::run(String a) {
|
||||
props.sendAllData();
|
||||
props.sendDone(a);
|
||||
}
|
||||
else if (a == u8"reset-mcu")
|
||||
{
|
||||
props.resetMcu(); // we prefer SSH command: echo %BROKER%> /root/broker && reset-mcu
|
||||
}
|
||||
else if (a == "clignoter:1")
|
||||
{
|
||||
clignoter.setValue(true);
|
||||
|
||||
@@ -52,7 +52,7 @@ void setup()
|
||||
}
|
||||
|
||||
delay(1500); // time for shield stuff
|
||||
|
||||
|
||||
// can do more static IP configuration, must be called after Ethernet.begin()
|
||||
//Ethernet.setSubnetMask(IPAddress(255, 255, 255, 0));
|
||||
//Ethernet.setGatewayIP(IPAddress(192, 168, 1, 1));
|
||||
@@ -92,6 +92,10 @@ void InboxMessage::run(String a) {
|
||||
props.sendAllData();
|
||||
props.sendDone(a);
|
||||
}
|
||||
else if (a == u8"reset-mcu")
|
||||
{
|
||||
props.resetMcu();
|
||||
}
|
||||
else if (a == "clignoter:1")
|
||||
{
|
||||
clignoter.setValue(true);
|
||||
|
||||
@@ -105,6 +105,10 @@ void InboxMessage::run(String a) {
|
||||
props.sendAllData();
|
||||
props.sendDone(a);
|
||||
}
|
||||
else if (a == u8"reset-mcu")
|
||||
{
|
||||
props.resetMcu();
|
||||
}
|
||||
else if (a == "clignoter:1")
|
||||
{
|
||||
clignoter.setValue(true);
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ void Props::resetMcu()
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_SAMD)
|
||||
NVIC_SystemReset();
|
||||
#elif defined(__AVR__)
|
||||
#elif defined(ARDUINO_ARCH_AVR)
|
||||
wdt_enable(WDTO_15MS);
|
||||
while (true);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user