I have following situation (see comment in code section).
Anybody an idea, why the processing of a http-request from a client (wifi_handler on core0) influences the task processing speed on core1 ?
I thought the cores are working independently...
Or is SPI the problem here?
I have to stop the wifi_AP, when the condition of loop task become TRUE, because of very high priority of loop.
If the condition become FALSE, then I restart wifi_AP.
The client has to reconnect everytime (very often) and that really suXX... I want to keep wifi on all the time.
Big thanks in advance!
Code: Select all
// Arduino Lib; using VSPI; SPI running @ 5MHz
my_vspi = new SPIClass(VSPI);
void setup(void)
{
xTaskCreatePinnedToCore (Wifi, "Wifi", 4096, NULL, 1, &xTaskHandle_Wifi, 0);
xTaskCreatePinnedToCore (loop, "loop", 4096, NULL, 1, &xTaskHandle_loop, 1);
}
void IRAM_ATTR loop (void *arg)
{
while(1)
{
if (conditions == TRUE)
{
/* Code:
* 74HC595 shiftout register is attached to VSPI
* 1. switch 74HC595 pin1 to HIGH
* 2. stay HIGH for 500us (not using vTaskDelay, not pausing the task!)
* 3. switch 74HC595 pin1 to LOW
* 4. stay LOW for 500us (not using vTaskDelay, not pausing the task!)
* -----> Works perfectly and very precisely, measured with DSO,
* AS LONG AS nobody is requesting something from the wifi server
* (client can stay connected and doing nothing).
* -----> If client requests something (http-request),
* then the 500us are not more precise and gets extended (600-700-800...1000us...),
* until the request is completely processed.
*/
}
}
}
void wifi_start(void);
void wifi_stop(void);
void wifi_handleClientRequest(void);
void Wifi (void *arg)
{
while(1)
{
// some logic...: if conditions==TRUE, then stop wifi_ap and restart it, when conditions==FALSE
wifi_handleClientRequest(); //wifi ap
}
}