Commit b77778b3 authored by Filip Demski's avatar Filip Demski
Browse files

SAMV71: Implemented transport

parent f22c963c
......@@ -31,8 +31,7 @@ extern QueueHandle_t @_Thread_Name_@_Global_Queue;
@@IF@@ @_RCM_@ = "CYCLIC_OPERATION"
void @_Thread_Name_@_Timer_Callback(TimerHandle_t timer)
{
struct Thread@_CAPITALIZE:Thread_Name_@Request request;
request.m_length = 0;
struct Thread@_CAPITALIZE:Thread_Name_@Request request = {0};
xQueueSend(@_Thread_Name_@_Global_Queue, &request, 0);
}
......@@ -55,7 +54,7 @@ void @_LOWER:Thread_Name_@_job(void* pvParameters)
for(;;)
{
struct Thread@_CAPITALIZE:Thread_Name_@Request request;
struct Thread@_CAPITALIZE:Thread_Name_@Request request = {0};
BaseType_t result = xQueueReceive(@_Thread_Name_@_Global_Queue,
&request,
portMAX_DELAY);
......
......@@ -5,12 +5,19 @@
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_partition.ascii
#include "transport.h"
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
// Sporadic required
@@TABLE@@
void deliver_to_@_LOWER:Out_Port_Remote_Function_@_@_LOWER:Out_Port_Remote_Port_Name_@(
const uint8_t* const data, const size_t length)
{
// SAMV71-TODO: impl
Broker_deliver_request(
INTERFACE_@_UPPER:Out_Port_Remote_Function_@_@_UPPER:Out_Port_Remote_Port_Name_@,
data,
length);
}
@@END_TABLE@@
......@@ -19,5 +26,7 @@ const uint8_t* const data, const size_t length)
void initialize_transport()
{
// SAMV71-TODO: impl
@@TABLE@@
interface_to_deliver_function[INTERFACE_@_UPPER:In_Port_Thread_Name_@] = &deliver_to_@_LOWER:In_Port_Thread_Name_@;
@@END_TABLE@@
}
......@@ -18,10 +18,20 @@
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
@@IF@@ @_RCM_@ /= "CYCLIC_OPERATION"
#include "thread_@_LOWER:Thread_Name_@.h"
void deliver_to_@_LOWER:Thread_Name_@(const uint8_t* const data, const size_t length)
{
// SAMV71-TODO: impl
extern QueueHandle_t @_Thread_Name_@_Global_Queue;
struct Thread@_CAPITALIZE:Thread_Name_@Request request = {0};
if(length > 0)
{
memcpy(request.m_data, data, length);
}
request.m_length = length;
xQueueSend(@_Thread_Name_@_Global_Queue, &request, 0);
}
@@END_IF@@
......@@ -26,4 +26,6 @@ void deliver_to_@_LOWER:Out_Port_Remote_Function_@_@_LOWER:Out_Port_Remote_Port_
void deliver_to_@_LOWER:Thread_Names_@(const uint8_t* const data, const size_t length);
@@END_TABLE@@
extern deliver_function interface_to_deliver_function[INTERFACE_MAX_ID];
#endif
......@@ -46,7 +46,7 @@ void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@IF@@ @_Kind_@ = SPORADIC_OPERATION
@@IF@@ @_No_Param_@
static uint8_t buffer_placeholder[1];
deliver_to_@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@(buffer_placeholde, 0);
deliver_to_@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@(buffer_placeholder, 0);
@@ELSE@@
deliver_to_@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@(
(const uint8_t*)(IN_buf_@_LOWER:Param_Names_@),
......
......@@ -39,6 +39,8 @@ void vApplicationGetTimerTaskMemory(StaticTask_t** ppxTimerTaskPCBBuffer,
extern void init_@_LOWER:Bound_Functions_@(void);
@@END_TABLE@@
deliver_function interface_to_deliver_function[INTERFACE_MAX_ID];
Uart consoleUart;
@@TABLE@@
......
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