summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/master_posix.c16
-rw-r--r--src/master_rtos.c6
2 files changed, 18 insertions, 4 deletions
diff --git a/src/master_posix.c b/src/master_posix.c
index 83eb741..c312757 100644
--- a/src/master_posix.c
+++ b/src/master_posix.c
@@ -28,6 +28,7 @@
#include "data.pb.h"
#include "stream.h"
#include "stream_stdio.h"
+#include "port.h"
/* FreeRTOS+POSIX. should go in the port folder */
/* #include "FreeRTOS_POSIX/pthread.h" */
@@ -45,7 +46,7 @@
#define SET_BIT_FROM_IDX(a, b) a[b>>5]|=(1<<(b%32))
#define COUNTOF(__BUFFER__) (sizeof(__BUFFER__) / sizeof(*(__BUFFER__)))
-#define BUS_DEVICE_LIMIT 16
+#define BUS_DEVICE_LIMIT 2
device_info_t *device_info[BUS_DEVICE_LIMIT] = {NULL};
subscription_info_t* subs_info[BUS_DEVICE_LIMIT];
@@ -101,6 +102,17 @@ void vStartPOSIXMaster(void *pvParams)
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)
+ *
+ */
+
+ p_stream_t *device_streams;
+ device_streams = malloc(sizeof(p_stream_t)*BUS_DEVICE_LIMIT);
+
+ initialize_devices(BUS_DEVICE_LIMIT, device_streams);
+
/* Add device-specific stream/thread declerations here, if needed */
/* ... */
@@ -147,6 +159,8 @@ static void *routing_func(void *pvArgs)
}
return NULL;
}
+
+/* This function should go into its own file, with a normalized state machine implementation */
hs_status_t handshake(uint32_t i2c_addr)
{
diff --git a/src/master_rtos.c b/src/master_rtos.c
index 4ca3461..27a78b8 100644
--- a/src/master_rtos.c
+++ b/src/master_rtos.c
@@ -3,7 +3,7 @@
#include "task.h"
/* System headers */
-#include <stdio.h>
+/* #include <stdio.h> */
/* Master include */
#include "master_posix.h"
@@ -54,8 +54,8 @@ void vAssertCalled(const char * pcFile,
(void) pcFileName;
(void) ulLineNumber;
- printf("vAssertCalled %s, %ld\n", pcFile, (long) ulLine);
- fflush(stdout);
+ /* printf("vAssertCalled %s, %ld\n", pcFile, (long) ulLine); */
+ /* fflush(stdout); */
/* Setting ulBlockVariable to a non-zero value in the debugger will allow
* this function to be exited. */