File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
#include " CEspControl.h"
2
- #include " CNetIf.h"
3
2
#include < string>
4
3
#include < vector>
5
4
@@ -23,8 +22,6 @@ using namespace std;
23
22
24
23
#define SerialESP Serial5
25
24
26
- extern int esp_host_spi_init ();
27
-
28
25
void getESPDebugLog ();
29
26
int displayMenu ();
30
27
void makeRequest (int req);
@@ -33,11 +30,13 @@ string prompt(string p);
33
30
34
31
const char mac_address[] = " aa:bb:cc:dd:ee:ff" ;
35
32
33
+ bool wifiHwInitialized = false ;
36
34
37
35
38
36
int initEvent (CCtrlMsgWrapper *resp) {
39
37
if (resp->isInitEventReceived () == ESP_CONTROL_OK) {
40
38
Serial.println (" [EVENT !!!!]: Init event received" );
39
+ wifiHwInitialized = true ;
41
40
}
42
41
}
43
42
@@ -83,10 +82,19 @@ void setup() {
83
82
CEspControl::getInstance ().listenForDisconnectionFromSoftApEvent (disconnectionFromSofApEvent);
84
83
85
84
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
+ }
87
96
88
97
Serial.println (" STARTING PROGRAM" );
89
- delay (1000 );
90
98
}
91
99
92
100
@@ -685,7 +693,7 @@ int displayMenu() {
685
693
cmd_acquired = true ;
686
694
rv = stoi (c);
687
695
}
688
- else {
696
+ else if (ch >= ' 0 ' && ch <= ' 9 ' ) {
689
697
c += ch;
690
698
}
691
699
}
Original file line number Diff line number Diff line change 35
35
#include " CCtrlWrapper.h"
36
36
#include " CEspCommunication.h"
37
37
#include " EspSpiDriver.h"
38
- #include " CNetIf.h"
39
38
#include " CEspCbks.h"
40
39
#include < string>
41
40
You can’t perform that action at this time.
0 commit comments