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

SAMV71: Implemented cyclic interface

parent 73c51455
......@@ -21,6 +21,7 @@
#include "thread_@_LOWER:Thread_Name_@.h"
#include <FreeRTOS.h>
#include <timers.h>
#include <queue.h>
#include "@_LOWER:Partition_Name_@_interface.h"
......@@ -28,13 +29,30 @@
extern QueueHandle_t @_Thread_Name_@_Global_Queue;
@@IF@@ @_RCM_@ = "CYCLIC_OPERATION"
// SAMV71-TODO: impl timer stuff
void @_Thread_Name_@_Timer_Callback(TimerHandle_t timer)
{
struct Thread@_CAPITALIZE:Thread_Name_@Request request;
request.m_length = 0;
xQueueSend(@_Thread_Name_@_Global_Queue, &request, 0);
}
StaticTimer_t @_LOWER:Thread_Name_@_Timer_Buffer = {0};
TimerHandle_t @_LOWER:Thread_Name_@_Timer = {0};
@@END_IF@@
void @_LOWER:Thread_Name_@_job(void* pvParameters)
{
@@IF@@ @_RCM_@ = "CYCLIC_OPERATION"
// SAMV71-TODO: impl timer stuff
TickType_t period = pdMS_TO_TICKS(@_Period_@);
@_LOWER:Thread_Name_@_Timer = xTimerCreateStatic("@_Thread_Name_@_Timer",
period,
pdTRUE,
NULL,
&@_Thread_Name_@_Timer_Callback,
&@_LOWER:Thread_Name_@_Timer_Buffer);
xTimerStart(@_LOWER:Thread_Name_@_Timer, portMAX_DELAY);
@@END_IF@@
for(;;)
{
struct Thread@_CAPITALIZE:Thread_Name_@Request request;
......
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