Commit 9fbc265e authored by Daniel Campora's avatar Daniel Campora
Browse files

cc3200: Add delays to allow the servers to start and stop properly.

parent d34c4784
......@@ -87,31 +87,30 @@ void TASK_Servers (void *pvParameters) {
for ( ;; ) {
if (servers_data.enabled) {
if (servers_data.do_disable) {
// disable network services
telnet_disable();
ftp_disable();
// now clear the flags
servers_data.do_disable = false;
servers_data.enabled = false;
}
else {
if (cycle) {
telnet_run();
}
else {
ftp_run();
}
}
}
else if (servers_data.do_enable) {
if (servers_data.do_enable) {
// enable network services
telnet_enable();
ftp_enable();
// now set/clear the flags
servers_data.enabled = true;
servers_data.do_enable = false;
servers_data.do_disable = false;
}
else if (servers_data.enabled && servers_data.do_disable) {
// disable network services
telnet_disable();
ftp_disable();
// now clear the flags
servers_data.do_disable = false;
servers_data.enabled = false;
servers_data.do_enable = false;
}
if (cycle) {
telnet_run();
}
else {
ftp_run();
}
// move to the next cycle
......@@ -125,6 +124,7 @@ void TASK_Servers (void *pvParameters) {
void servers_start (void) {
servers_data.do_disable = false;
servers_data.do_enable = true;
HAL_Delay (SERVERS_CYCLE_TIME_MS * 5);
}
void servers_stop (void) {
......@@ -133,6 +133,7 @@ void servers_stop (void) {
do {
HAL_Delay (SERVERS_CYCLE_TIME_MS);
} while (servers_are_enabled());
HAL_Delay (SERVERS_CYCLE_TIME_MS * 5);
}
bool servers_are_enabled (void) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment