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

SAMV71: Some basic task creation

parent a4226a9e
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- Specify the file name for a protected block
@@-- @_Block_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node as defined in the Deployment View
@@-- The content of this file is generated from node.tmplt
@@-- If there is no string defined here, no file will be generated per node,
@@-- (that's an option if the intent is to generate only one file per system)
@@-- Specify the file name for a partition
@@-- @_Partition_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
@@-- Specify the file name for a thread
@@-- @_Thread_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Partition_Name_@/thread_@_LOWER:Thread_Name_@.h
@@-- The up to date list of tags available for this template is available here:
@@-- https://taste.tuxfamily.org/wiki/index.php?title=Kazoo_Templates_Documentation#templates.2Fconcurrency_view.2Fsub.2Fnode.tmplt
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_node.ascii
@@-- The up to date list of tags available for this template is available here:
@@-- https://taste.tuxfamily.org/wiki/index.php?title=Kazoo_Templates_Documentation#templates.2Fconcurrency_view.2Fsub.2Fpartition.tmplt
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_partition.ascii
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Partition_Name_@ : Partition name for parent function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Remote_Function_Names_@ : List of callers
@@-- @_Remote_Interface_Names_@ : |_ caller's interface name
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Language_@ : The implementation language of the function
@@-- @_Partition_Name_@ : Partition name for parent function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Remote_Function_Names_@ : List of callees
@@-- @_Remote_Interface_Names_@ : |_ callee's interface name
@@-- @_Remote_Languages_@ : |_ callee's function language
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@-- The following tags are available in this template:
@@--
@@-- @_Nodes_@ : Code generated for the nodes
@@-- @_Node_Names_@ : Vector Tag of node names
@@-- @_Node_CPU_@ : |_ Corresponding CPU name (eg x86_linux)
@@-- @_Node_CPU_Classifier_@ : |_ CPU Classifier (ocarina...::x86_linux)
@@-- @_Partition_Names_@ : Vector Tag of partition names
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- And all the system configuration obtained from the command line:
@@-- Interface_View, Deployment_View, Data_View, Binary_Path, Check_Data_View,
@@-- Output_Dir, Skeletons, Glue, Use_POHIC, Timer_Resolution, Debug_Flag,
@@-- No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
@@-- The following tags are available in this template:
@@--
@@-- @_Thread_Name_@ : Thread name
@@-- @_Entry_Port_Name_@ : Name of the PI
@@-- @_RCM_@ : One of "CYCLIC_OPERATION", "SPORADIC_OPERATION"
@@-- @_Need_Mutex_@ : True if the PI is shared with others in the protected block
@@-- @_Pro_Block_Name_@ : Name of the protected function
@@-- @_Node_Name_@ : Name of the deployment node
@@-- @_Remote_Threads_@ : Vector tag: output remote thread list
@@-- @_RI_Port_Name_@ : |_ Corresponding local RI name
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@-- @_Remote_PI_Sorts_@ : |_ Optional param type of the remote thread
@@-- @_Remote_PI_Modules_@ : |_ Asn1 module of the optional param type
@@-- Tags related to the PI that is at the origin of the thread creation:
@@-- @_Name_@, @_Kind_@, @_Parent_Function_@ : shoud be useless here
@@-- @_Param_Names_@, _Types_@, _ASN1_Modules, _Encodings_@, _Directions_@ : param vector tag
@@-- @_Period_@, @_WCET_@, @_Queue_Size_@ : relevant here
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
#ifndef @_Thread_Name_@_INCLUDED
#define @_Thread_Name_@_INCLUDED
void prv_@_Thread_Name_@_Task(void* pvParameters);
#endif // @_Thread_Name_@_INCLUDED
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- Use_POHIC
@@-- Debug
@@-- No_Stdlib
@@IF@@ @_CPU_Platform_@ = PLATFORM_SAMV71_FREERTOS
TRUE
@@END_IF@@
......@@ -48,6 +48,7 @@ project @_CAPITALIZE:Name_@ is
"@_LOWER:Name_@/drivers/@_Device_Driver_Names_@",
@@END_TABLE@@
"../system_spec",
"@_LOWER:Name_@/runtime",
"@_LOWER:Name_@/runtime/Packetizer",
"@_LOWER:Name_@/runtime/Broker",
"@_LOWER:Name_@/runtime/RuntimeCommon",
......
......@@ -4,15 +4,69 @@
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_partition.ascii
/* File generated by kazoo for TASTE - do not edit */
#include <assert.h>
#include <stdlib.h>
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include <Broker/Broker.h>
#include <Init/Init.h>
#include <Uart/Uart.h>
@@TABLE@@
#include "thread_@_LOWER:Thread_Names_@.h"
@@END_TABLE@@
void vApplicationMallocFailedHook();
void vApplicationStackOverflowHook(TaskHandle_t pxTask, char* pcTaskName);
void vApplicationIdleHook();
void vApplicationTickHook();
@@TABLE@@
extern void init_@_LOWER:Bound_Functions_@(void);
@@END_TABLE@@
Uart consoleUart;
// the main function
@_Threads_@
int main(void)
{
Init_setup_hardware();
// SAMV71-TODO: Transport_initialize();
Broker_initialize();
vTaskStartScheduler();
for(;;) {
;
}
return EXIT_SUCCESS;
}
return 0;
void vApplicationMallocFailedHook()
{
configASSERT(0);
}
void vApplicationStackOverflowHook(TaskHandle_t pxTask, char* pcTaskName)
{
(void)pxTask;
(void)pcTaskName;
configASSERT(0);
}
void vApplicationIdleHook()
{
volatile size_t xFreeHeapSpace = xPortGetFreeHeapSize();
(void)xFreeHeapSpace;
}
void vApplicationTickHook()
{
}
......@@ -18,3 +18,26 @@
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
/* __attribute__ ((persistent)) */ QueueHandle_t @_Thread_Name_@_Global_Queue = NULL;
/* __attribute__ ((persistent)) */ static StaticQueue_t prv_@_LOWER:Thread_Name_@_Static_Queue = {0};
/* __attribute__ ((persistent)) */ static uint8_t prv_@_LOWER:Thread_Name_@_Queue_Buffer[@_Queue_Size_@ * sizeof(uint8_t)] = {0};
/* __attribute__ ((persistent)) */ static StaticTask_t prv_@_LOWER:Thread_Name_@_TCB = {0};
/* __attribute__ ((persistent)) */ static StackType_t prv_@_LOWER:Thread_Name_@_Stack[@_Stack_Size_In_Bytes_@ / sizeof(StackType_t)] = {0};
static void Initialize_Thread_@_LOWER:Thread_Name_@(void)
{
@_Thread_Name_@_Global_Queue = xQueueCreateStatic(@_Queue_Size_@,
sizeof(uint8_t), // SAMV71-TODO: Request?
prv_@_LOWER:Thread_Name_@_Queue_Buffer,
&prv_@_LOWER:Thread_Name_@_Static_Queue);
xTaskCreateStatic(prv_@_Thread_Name_@_Task,
"@_Thread_Name_@",
@_Stack_Size_In_Bytes_@ / sizeof(StackType_t),
NULL,
@_Priority_@,
prv_@_LOWER:Thread_Name_@_Stack,
&prv_@_LOWER:Thread_Name_@_TCB);
}
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