diff options
| author | Aditya Naik | 2021-04-20 13:11:16 -0400 |
|---|---|---|
| committer | Aditya Naik | 2021-04-20 13:11:16 -0400 |
| commit | ae4978977d3a2ca1e9493c1152aed35078fd846e (patch) | |
| tree | 34dee1775ef3c63dd443cb0c18c2fdd1e19c1eb6 /src/main_posix.c | |
Cleanup and README
Diffstat (limited to 'src/main_posix.c')
| -rw-r--r-- | src/main_posix.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/main_posix.c b/src/main_posix.c new file mode 100644 index 0000000..ca48ef7 --- /dev/null +++ b/src/main_posix.c @@ -0,0 +1,60 @@ + +/* + * TODO Do conditional includes based on which target we are building for. + * Actually, target-specific includes should go in the port folder + * This should be specified in the master config file + * TODO This file should be moved to the posix port folder + * + */ + +/* FreeRTOS includes. */ +/* #include "FreeRTOS_POSIX.h" */ + +/* System headers. */ +#include <stdbool.h> +#include <string.h> +#include <stdio.h> + +/* (Ideally) platform-agnostic project includes. */ +#include "master_posix.h" +#include "main.h" +#include "port.h" + +/* FreeRTOS+POSIX. should go in the port folder */ +/* #include "FreeRTOS_POSIX/pthread.h" */ +/* #include "FreeRTOS_POSIX/mqueue.h" */ +/* #include "FreeRTOS_POSIX/time.h" */ +/* #include "FreeRTOS_POSIX/fcntl.h" */ +/* #include "FreeRTOS_POSIX/errno.h" */ + +/*-----------------------------------------------------------*/ + +/** + * @brief Main function; + * + * See the top of this file for detailed description. + */ +void vStartPOSIXMaster(void *pvParams) +{ + pthread_t handshake_thread, dataflow_thread, routing_thread; + + /* Stream initializations should be handled by the devicetree library once that's set up */ + + /* pthread_create(&handshake_thread, NULL, handshake_func, NULL); */ + pthread_create(&dataflow_thread, NULL, dataflow_func, NULL); + /* pthread_create(&routing_thread, NULL, routing_func, NULL); */ + + + /* This function will be defined for the port + * Each port will have a configuration file that includes details about the bus, + * either in a custom format or in a devicetree format (preferred) + * + */ + + /* Add device-specific stream/thread declerations here, if needed */ + /* ... */ + + /* This task was created with the native xTaskCreate() API function, so + must not run off the end of its implementing thread. */ + /* vTaskDelete(NULL); */ +} |
