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