File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,16 @@ void CAtHandler::onWiFiEvent(WiFiEvent_t event) {
88
88
89
89
}
90
90
91
+ TaskHandle_t atTask;
92
+ void atLoop (void * param) {
93
+ while (1 ) {
94
+ if (_baud != 1200 && _baud != 2400 ) {
95
+ atHandler.run ();
96
+ }
97
+ yield ();
98
+ }
99
+ }
100
+
91
101
/* -------------------------------------------------------------------------- */
92
102
void setup () {
93
103
/* -------------------------------------------------------------------------- */
@@ -124,6 +134,14 @@ void setup() {
124
134
WiFi.onEvent (CAtHandler::onWiFiEvent);
125
135
126
136
137
+ xTaskCreatePinnedToCore (
138
+ atLoop, /* Function to implement the task */
139
+ " Task1" , /* Name of the task */
140
+ 10000 , /* Stack size in words */
141
+ NULL , /* Task input parameter */
142
+ 0 , /* Priority of the task */
143
+ &atTask, /* Task handle. */
144
+ 0 ); /* Core where the task should run */
127
145
}
128
146
129
147
/*
@@ -154,10 +172,6 @@ void loop() {
154
172
SERIAL_USER.write (buf, i);
155
173
}
156
174
157
- if (_baud != 1200 && _baud != 2400 ) {
158
- atHandler.run ();
159
- }
160
-
161
175
yield ();
162
176
}
163
177
You can’t perform that action at this time.
0 commit comments