This repository was archived by the owner on Sep 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -617,8 +617,6 @@ void hardReset()
617617
618618 delay (1000 );
619619
620- SPIFFS.format ();
621-
622620 // remove config file
623621 SPIFFS.remove (CONFIG_FILE);
624622 log (" /awtrix.json removed" );
@@ -670,7 +668,7 @@ void onButtonPressedForDuration()
670668 client.publish (" awtrixmatrix/button" , " pressed long" );
671669}
672670
673- void onButtonPressedForHardReset ()
671+ void onButtonSequence ()
674672{
675673 if (!client.connected ())
676674 {
@@ -679,8 +677,6 @@ void onButtonPressedForHardReset()
679677
680678 client.publish (" awtrixmatrix/button" , " pressed for hard reset" );
681679
682- delay (1000 );
683-
684680 hardReset ();
685681}
686682
@@ -892,8 +888,8 @@ void setup()
892888
893889 button.begin ();
894890 button.onPressed (onButtonPressed);
895- // button.onPressedFor(2000, onButtonPressedForDuration); // TODO extend library to support multiple pressedFor events
896- button.onPressedFor ( 15000 , onButtonPressedForHardReset );
891+ button.onPressedFor (2000 , onButtonPressedForDuration);
892+ button.onSequence ( 8 , 2000 , onButtonSequence );
897893
898894 matrix->clear ();
899895 matrix->setCursor (6 , 6 );
You can’t perform that action at this time.
0 commit comments