File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 11#include " CEspControl.h"
2- #include " CNetIf.h"
32#include < string>
43#include < vector>
54
@@ -23,8 +22,6 @@ using namespace std;
2322
2423#define SerialESP Serial5
2524
26- extern int esp_host_spi_init ();
27-
2825void getESPDebugLog ();
2926int displayMenu ();
3027void makeRequest (int req);
@@ -33,11 +30,13 @@ string prompt(string p);
3330
3431const char mac_address[] = " aa:bb:cc:dd:ee:ff" ;
3532
33+ bool wifiHwInitialized = false ;
3634
3735
3836int initEvent (CCtrlMsgWrapper *resp) {
3937 if (resp->isInitEventReceived () == ESP_CONTROL_OK) {
4038 Serial.println (" [EVENT !!!!]: Init event received" );
39+ wifiHwInitialized = true ;
4140 }
4241}
4342
@@ -83,10 +82,19 @@ void setup() {
8382 CEspControl::getInstance ().listenForDisconnectionFromSoftApEvent (disconnectionFromSofApEvent);
8483
8584
86-
85+ int err = CEspControl::getInstance ().initSpiDriver ();
86+ if (err != 0 ) {
87+ Serial.print (" Error initSpiDriver err " );
88+ Serial.println (err);
89+ } else {
90+ Serial.println (" initSpiDriver OK" );
91+ }
92+ while (!wifiHwInitialized) {
93+ CEspControl::getInstance ().communicateWithEsp ();
94+ delay (100 );
95+ }
8796
8897 Serial.println (" STARTING PROGRAM" );
89- delay (1000 );
9098}
9199
92100
@@ -685,7 +693,7 @@ int displayMenu() {
685693 cmd_acquired = true ;
686694 rv = stoi (c);
687695 }
688- else {
696+ else if (ch >= ' 0 ' && ch <= ' 9 ' ) {
689697 c += ch;
690698 }
691699 }
Original file line number Diff line number Diff line change 3535#include " CCtrlWrapper.h"
3636#include " CEspCommunication.h"
3737#include " EspSpiDriver.h"
38- #include " CNetIf.h"
3938#include " CEspCbks.h"
4039#include < string>
4140
You can’t perform that action at this time.
0 commit comments