forked from mcknly/breadboard-os
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mcknly#20): WIP - first pass at basic wifi service concepts
- Loading branch information
Showing
6 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/****************************************************************************** | ||
* @file wifi_service.c | ||
* | ||
* @brief WiFi service implementation and FreeRTOS task creation. | ||
* | ||
* @author Alec Lanter | ||
* | ||
* @date 2024-06-25 | ||
* | ||
* @copyright Copyright (c) 2024 Alec Lanter | ||
* Released under the MIT License | ||
* | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************/ | ||
|
||
#include "rtos_utils.h" | ||
#include "services.h" | ||
#include "service_queues.h" | ||
#include "FreeRTOS.h" | ||
#include "task.h" | ||
#include "pico/cyw43_arch.h" | ||
|
||
#define SERVICE_NAME_WIFI wifi_init | ||
#define PRIORITY_WIFI 2 | ||
#define STACK_WIFI configMINIMAL_STACK_SIZE | ||
|
||
static void prvWifiTask(void *pvParameters); | ||
|
||
TaskHandle_t xWifiTask; | ||
|
||
BaseType_t wifi_service(void) { | ||
if(cyw43_arch_init()) { | ||
cli_print_raw("failed to initialize cyw43 architecture on pico_w"); | ||
return pdFAIL; | ||
} | ||
|
||
BaseType_t xReturn; | ||
|
||
xReturn = xTaskCreate( | ||
prvWifiTask, | ||
xstr(SERVICE_NAME_WIFI), | ||
STACK_WIFI, | ||
NULL, | ||
PRIORITY_WIFI, | ||
&xWifiTask | ||
); | ||
|
||
if (xReturn == pdPASS) { | ||
cli_print_raw("wifi service started"); | ||
} else { | ||
cli_print_raw("Error starting wifi service"); | ||
} | ||
|
||
return xReturn; | ||
} | ||
|
||
static void prvWifiTask(void *pvParameters) { | ||
cli_print_timestamped("wifi not implemented..."); | ||
|
||
// todo : on start, query flashfs for wifi configuration and, if exists, perform config | ||
|
||
// todo : wifi queue to handle reconfiguration on request from cli | ||
task_self_terminate(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters