aboutsummaryrefslogtreecommitdiff
path: root/src/main_posix.c
blob: ca48ef7062718afd1688914f84c05a54a97c20c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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); */
}