checked in missing file
git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@240 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -221,13 +221,15 @@ static void initTask(void* parameters)
|
||||
hwTestItems.cat2Relay = NULL;
|
||||
hwTestItems.pcba = pcba;
|
||||
// EEPROM TO BE DONE
|
||||
HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 2, 1024);
|
||||
// HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 2, 1024);
|
||||
|
||||
|
||||
MAX5715_construct(&max5715, &spiDAC->device);
|
||||
|
||||
MAX5715_writeREF_ON_2V5(&max5715, MAX5715_SEL_DACA | MAX5715_SEL_DACB | MAX5715_SEL_DACC);
|
||||
|
||||
MAX5715Channel_construct(&max5715.dac[0], &max5715, 0);
|
||||
|
||||
|
||||
repairProcess_construct(rp, 3, 1024);
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @file repairProcess.c
|
||||
/// @brief Description
|
||||
// -----------------------------------------------------------------------------
|
||||
// Micro-Key bv
|
||||
// Industrieweg 28, 9804 TG Noordhorn
|
||||
// Postbus 92, 9800 AB Zuidhorn
|
||||
// The Netherlands
|
||||
// Tel: +31 594 503020
|
||||
// Fax: +31 594 505825
|
||||
// Email: support@microkey.nl
|
||||
// Web: www.microkey.nl
|
||||
// -----------------------------------------------------------------------------
|
||||
/// $Revision$
|
||||
/// $Author$
|
||||
/// $Date$
|
||||
// (c) 2017 Micro-Key bv
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// @file repairProcess.c
|
||||
/// @ingroup {group_name}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "repairProcess.h"
|
||||
#include "repairPreset.h"
|
||||
|
||||
#include "Logger.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// File-scope variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static void repairProcess_task(void* parameters);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
ErrorStatus repairProcess_construct(struct RepairProcess* self, int taskPriority, uint16_t stackSize)
|
||||
{
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
|
||||
if (!self->initialized)
|
||||
{
|
||||
// Create a semaphore to sync access to the display shadow
|
||||
vSemaphoreCreateBinary(self->secondsSyncronisation);
|
||||
xSemaphoreGive(self->secondsSyncronisation);
|
||||
|
||||
|
||||
if (xTaskCreate(repairProcess_task, "RepairProcess", stackSize, self, taskPriority, &self->taskHandle) != pdTRUE)
|
||||
{
|
||||
returnValue = ERROR;
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
self->runTask = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = ERROR;
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
void repairProcess_feedSecondsCounter(struct RepairProcess* self)
|
||||
{
|
||||
xSemaphoreGive(self->secondsSyncronisation);
|
||||
|
||||
}
|
||||
|
||||
void repairProcess_feedSecondsCounterFromISR(struct RepairProcess* self)
|
||||
{
|
||||
portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
xSemaphoreGiveFromISR(self->secondsSyncronisation, &higherPriorityTaskWoken);
|
||||
|
||||
portEND_SWITCHING_ISR(higherPriorityTaskWoken);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void repairProcess_task(void* parameters)
|
||||
{
|
||||
struct RepairProcess* self = (struct RepairProcess*)parameters;
|
||||
|
||||
|
||||
while(self->runTask)
|
||||
{
|
||||
xSemaphoreTake(self->secondsSyncronisation, portMAX_DELAY);
|
||||
int hours = (self->secondsCounter / (60 * 60));
|
||||
int minutes = (self->secondsCounter - (hours * 60 * 60)) / 60;
|
||||
int seconds = (self->secondsCounter - (hours * 60 * 60) - (minutes * 60));
|
||||
LOGGER_WARNING(mainLog, "--- Repair clock %02i %02d %02d", hours, minutes, seconds);
|
||||
|
||||
self->secondsCounter++;
|
||||
}
|
||||
|
||||
vTaskDelete(self->taskHandle);
|
||||
}
|
||||
Reference in New Issue
Block a user