From a48164fe7a02913f5fdec1928a73fb767c2d0f53 Mon Sep 17 00:00:00 2001 From: mmi Date: Wed, 13 Dec 2017 13:22:06 +0000 Subject: [PATCH] Added buzzer Added powerloss detector Added buzzer behaviour to system. Added powerloss behaviour to system Added french translation to menu texts git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@359 05563f52-14a8-4384-a975-3d1654cca0fa --- .../3 - Implementation/0 - Code/HAL/Makefile | 1 + .../0 - Code/HAL/inc/Buzzer.h | 161 ++++++++++++++ .../0 - Code/HAL/src/Buzzer.c | 182 ++++++++++++++++ .../0 - Code/HAL/src/HighVoltageDetection.c | 20 +- .../0 - Code/HAL/src/Leds.c | 8 +- .../0 - Code/Platform/inc/platform.h | 1 + .../0 - Code/Platform/src/keypadMatrix.c | 1 + .../0 - Code/Platform/src/oli_stm32_h107.c | 32 ++- .../0 - Code/hsb-mrts/Makefile | 1 + .../0 - Code/hsb-mrts/inc/Error.h | 1 + .../0 - Code/hsb-mrts/inc/MenuCore.h | 8 +- .../0 - Code/hsb-mrts/inc/MenuText.h | 170 +++++++++------ .../0 - Code/hsb-mrts/inc/PowerLossDetector.h | 118 +++++++++++ .../0 - Code/hsb-mrts/inc/hsb-mrts.h | 8 +- .../0 - Code/hsb-mrts/inc/repairMenu.h | 3 + .../0 - Code/hsb-mrts/inc/repairProcesses.h | 2 +- .../0 - Code/hsb-mrts/src/MenuCore.c | 20 +- .../0 - Code/hsb-mrts/src/PowerLossDetector.c | 199 ++++++++++++++++++ .../0 - Code/hsb-mrts/src/hsb-mrts.c | 113 +++++----- .../0 - Code/hsb-mrts/src/main.c | 44 +++- .../0 - Code/hsb-mrts/src/repairMenu.c | 20 ++ .../0 - Code/hsb-mrts/src/repairMenus.c | 15 +- .../0 - Code/hsb-mrts/src/repairProcess.c | 4 +- .../0 - Code/hsb-mrts/src/repairProcesses.c | 1 + 24 files changed, 973 insertions(+), 160 deletions(-) create mode 100644 S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/inc/Buzzer.h create mode 100644 S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Buzzer.c create mode 100644 S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/PowerLossDetector.h create mode 100644 S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/PowerLossDetector.c diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/Makefile b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/Makefile index f932213..75a2526 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/Makefile +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/Makefile @@ -24,6 +24,7 @@ ARFLAGS = rs OBJECTS = \ ADCDevice.o \ +Buzzer.o \ CachedStorage.o \ CoverSolenoid.o \ crc32.o \ diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/inc/Buzzer.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/inc/Buzzer.h new file mode 100644 index 0000000..44177ea --- /dev/null +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/inc/Buzzer.h @@ -0,0 +1,161 @@ +// ----------------------------------------------------------------------------- +/// @file Buzzer.h +/// @brief File 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) 2015 Micro-Key bv +// ----------------------------------------------------------------------------- + +/// @defgroup {group_name} {group_description} +/// Description + +/// @file Buzzer.h +/// @ingroup {group_name} + +#ifndef INC_BUZZER_H_ +#define INC_BUZZER_H_ + + +// ----------------------------------------------------------------------------- +// Include files +// ----------------------------------------------------------------------------- + +#include + +#include "FreeRTOS.h" +#include "task.h" +#include "semphr.h" + +#include "stm32f10x.h" + +// ----------------------------------------------------------------------------- +// Constant and macro definitions +// ----------------------------------------------------------------------------- + +#define BUZZER_MIN_PULSEWIDTH_MS (10) +#define BUZZER_KEYPAD_PULSEWIDTH_MS (60) +#define BUZZER_ERROR_PULSEWIDTH_MS (1000) +#define BUZZER_WARNING_PULSEWIDTH_MS (500) + +#define BUZZER_KEYPAD_ACKNOWLEDGE(self) \ + Buzzer_singleTone(self, BUZZER_KEYPAD_PULSEWIDTH_MS) + +#define BUZZER_ERROR(self) \ + Buzzer_start(self, BUZZER_ERROR_PULSEWIDTH_MS) + +#define BUZZER_WARNING(self) \ + Buzzer_start(self, BUZZER_WARNING_PULSEWIDTH_MS) + +// ----------------------------------------------------------------------------- +// Type definitions. +// ----------------------------------------------------------------------------- + +struct Buzzer +{ + // General + bool initialized; + struct Gpio* gpio; + // Functionary properties + unsigned int pulseWidth; + // Task properties + bool runTask; + bool runPeriodically; + SemaphoreHandle_t semaphore; + xTaskHandle taskHandle; + int taskPriority; + uint16_t stackSize; +}; + +// ----------------------------------------------------------------------------- +// Function declarations +// ----------------------------------------------------------------------------- + +/** ---------------------------------------------------------------------------- + * Buzzer_construct + * Description of function + * + * @param self + * @param gpio + * @param taskPriority + * @param stackSize + * + * @return ErrorStatus + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern ErrorStatus Buzzer_construct(struct Buzzer* self, struct Gpio* gpio, int taskPriority, uint16_t stackSize); + + +/** ---------------------------------------------------------------------------- + * Buzzer_destruct + * Description of function + * + * @param self + * + * @return void + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern void Buzzer_destruct(struct Buzzer* self); + + +/** ---------------------------------------------------------------------------- + * Buzzer_start + * Description of function + * + * @param self + * @param pulseWidth + * + * @return void + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern void Buzzer_start(struct Buzzer* self, unsigned int pulseWidth); + + +/** ---------------------------------------------------------------------------- + * Buzzer_stop + * Description of function + * + * @param self + * @param + * @return void + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern void Buzzer_stop(struct Buzzer* self); + + +/** ---------------------------------------------------------------------------- + * Buzzer_singleTone + * Description of function + * + * @param self + * @param pulseWidth + * @return void + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern void Buzzer_singleTone(struct Buzzer* self, unsigned int pulseWidth); + + + + + +#endif /* INC_BUZZER_H_ */ diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Buzzer.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Buzzer.c new file mode 100644 index 0000000..d2dcc74 --- /dev/null +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Buzzer.c @@ -0,0 +1,182 @@ +// ----------------------------------------------------------------------------- +/// @file Buzzer.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 Buzzer.c +/// @ingroup {group_name} + + +// ----------------------------------------------------------------------------- +// Include files +// ----------------------------------------------------------------------------- + +#include "Buzzer.h" +#include "gpio.h" +#include "IODevice.h" +#include "Logger.h" + +// ----------------------------------------------------------------------------- +// Constant and macro definitions +// ----------------------------------------------------------------------------- + + + +// ----------------------------------------------------------------------------- +// Type definitions +// ----------------------------------------------------------------------------- + + + +// ----------------------------------------------------------------------------- +// File-scope variables +// ----------------------------------------------------------------------------- + + + +// ----------------------------------------------------------------------------- +// Function declarations +// ----------------------------------------------------------------------------- + +static void BuzzerTask(void* parameters); + +// ----------------------------------------------------------------------------- +// Function definitions +// ----------------------------------------------------------------------------- + +ErrorStatus Buzzer_construct(struct Buzzer* self, struct Gpio* gpio, int taskPriority, uint16_t stackSize) +{ + ErrorStatus returnValue = SUCCESS; + + if (!self->initialized) + { + if (returnValue == SUCCESS) + { + if (gpio != NULL) + { + self->gpio = gpio; + } + else + { + returnValue = ERROR; + } + } + if (returnValue == SUCCESS) + { + self->taskPriority = taskPriority; + self->stackSize = stackSize; + } + + if (returnValue == SUCCESS) + { + vSemaphoreCreateBinary(self->semaphore); + self->runPeriodically = false; + } + + + BaseType_t ctReturn = 0; + if (returnValue == SUCCESS) + { + self->runTask = true; + ctReturn = xTaskCreate(BuzzerTask, (const char*)"BuzzerTask", self->stackSize, self, self->taskPriority, &self->taskHandle); + } + if (ctReturn != pdPASS) + { + returnValue = ERROR; + LOGGER_ERROR(mainLog, "Buzzer task failed to create with error %d", (int)ctReturn); + } + else + { + self->initialized = true; + LOGGER_INFO(mainLog, "Buzzer task created successfully"); + } + } + else + { + returnValue = ERROR; + } + return returnValue; +} + + + +extern void Buzzer_destruct(struct Buzzer* self) +{ + self->runTask = false; + self->initialized = false; +} + + +void Buzzer_start(struct Buzzer* self, unsigned int pulseWidth) +{ + if (self->initialized) + { + if (pulseWidth >= BUZZER_MIN_PULSEWIDTH_MS) + { + self->pulseWidth = pulseWidth; + xSemaphoreGive(self->semaphore); + self->runPeriodically = true; + } + } +} + + + +void Buzzer_stop(struct Buzzer* self) +{ + if (self->initialized) + { + self->runPeriodically = false; + } +} + + +void Buzzer_singleTone(struct Buzzer* self, unsigned int pulseWidth) +{ + if (self->initialized) + { + self->runPeriodically = false; + self->pulseWidth = pulseWidth; + xSemaphoreGive(self->semaphore); + } +} + + +static void BuzzerTask(void* parameters) +{ + char cTrue = (char)true; + char cFalse = (char)false; + struct Buzzer* self = (struct Buzzer*)parameters; + + while (self->runTask) + { + xSemaphoreTake(self->semaphore, portMAX_DELAY); + + IODevice_write(&self->gpio->device, &cTrue, 1); + vTaskDelay(self->pulseWidth); + IODevice_write(&self->gpio->device, &cFalse, 1); + vTaskDelay(self->pulseWidth); + + // For periodic use, give semaphore + if (self->runPeriodically) + { + xSemaphoreGive(self->semaphore); + } + } + LOGGER_INFO(mainLog, "Deleting task %s", pcTaskGetTaskName(self->taskHandle)); + vTaskDelete(NULL); +} diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/HighVoltageDetection.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/HighVoltageDetection.c index e7330d2..8f9131d 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/HighVoltageDetection.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/HighVoltageDetection.c @@ -42,9 +42,9 @@ struct HighVoltageDetection { - struct IODevice* hv0; - struct IODevice* hv1; - struct IODevice* hv2; + struct Gpio* hv0; + struct Gpio* hv1; + struct Gpio* hv2; bool initialized; }; @@ -71,9 +71,9 @@ ErrorStatus HighVoltageDetection_construct(struct Gpio* HV0_gpio, struct Gpio* H if (!hvDetection->initialized) { - hvDetection->hv0 = &HV0_gpio->device; - hvDetection->hv1 = &HV1_gpio->device; - hvDetection->hv2 = &HV2_gpio->device; + hvDetection->hv0 = HV0_gpio; + hvDetection->hv1 = HV1_gpio; + hvDetection->hv2 = HV2_gpio; hvDetection->initialized = true; } else @@ -102,10 +102,11 @@ bool HighVoltageDetection_isVoltagePresent(void) char value0; char value1; char value2; + size_t al; - IODevice_read(hvDetection->hv0, &value0, 1, NULL); - IODevice_read(hvDetection->hv1, &value1, 1, NULL); - IODevice_read(hvDetection->hv2, &value2, 1, NULL); + IODevice_read((struct IODevice*)hvDetection->hv0, &value0, 1, &al); + IODevice_read((struct IODevice*)hvDetection->hv1, &value1, 1, &al); + IODevice_read((struct IODevice*)hvDetection->hv2, &value2, 1, &al); if (PCBA_getInstance()->pcba == PCBA_Tesla) { @@ -127,5 +128,6 @@ bool HighVoltageDetection_isVoltagePresent(void) } } + return returnValue; } diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Leds.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Leds.c index b3f89f8..eab0a5f 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Leds.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/HAL/src/Leds.c @@ -157,8 +157,9 @@ extern bool Led_getStatus(Led led) { char valueRed; char valueGreen; - IODevice_read(self.leds[LED_BICOLOR_RED].ioDevice, &valueRed, 1, NULL); - IODevice_read(self.leds[LED_BICOLOR_GREEN].ioDevice, &valueGreen, 1, NULL); + size_t al; + IODevice_read(self.leds[LED_BICOLOR_RED].ioDevice, &valueRed, 1, &al); + IODevice_read(self.leds[LED_BICOLOR_GREEN].ioDevice, &valueGreen, 1, &al); if ((valueRed != (char)false) && (valueGreen != (char)false)) { returnValue = true; @@ -167,7 +168,8 @@ extern bool Led_getStatus(Led led) else { char value; - IODevice_read(self.leds[led].ioDevice, &value, 1, NULL); + size_t al; + IODevice_read(self.leds[led].ioDevice, &value, 1, &al); if (value != (char)false) { returnValue = true; diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/inc/platform.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/inc/platform.h index de38f14..ea5883b 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/inc/platform.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/inc/platform.h @@ -61,6 +61,7 @@ typedef struct GPIO_InitTypeDef GPIO_InitStruct; } T_PL_GPIO; +extern struct Buzzer* mainBuzzer; extern struct Logger* mainLog; // Export of ADCs diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c index 9d76313..58f2306 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/keypadMatrix.c @@ -108,6 +108,7 @@ ErrorStatus Keypad_construct(struct Keypad* self, size_t numberOfRows, size_t nu if(returnValue == SUCCESS) { + ///TODO THIS SHOULD BE SELF INSTEAD OF KEYPAD, RIGHT? xTaskCreate(KeypadTask, (const char*)"keypadTask", self->stackSize, keypad, self->taskPriority, &self->taskHandle); } diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/oli_stm32_h107.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/oli_stm32_h107.c index 6309d45..cda6e48 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/oli_stm32_h107.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/oli_stm32_h107.c @@ -42,6 +42,7 @@ #include "Logger.h" #include "platform.h" +#include "Buzzer.h" #include "CathodeMCP.h" #include "CoverSolenoid.h" #include "gpio.h" @@ -85,6 +86,10 @@ #define SPI_LCD_RX_QUEUE (32) #define SPI_LCD_TX_QUEUE (32) +// Buzzer Settings +#define BUZZER_STACK_SIZE (128) +#define BUZZER_TASK_PRIORITY (3) + // Keypad Settings #define KEYPAD_DEBOUNCE_TIME_MS (20) #define KEYPAD_STACK_SIZE (128) @@ -107,6 +112,8 @@ // Logger static struct Logger _mainLog = {.initialized = false}; +// Buzzer +static struct Buzzer _mainBuzzer = {.initialized = false}; // ADC static struct Adc _adc1 = {.initialized = false}; @@ -170,6 +177,8 @@ static struct MAX5715 _max5715 = {.initialized = false}; struct Logger* mainLog = &_mainLog; +struct Buzzer* mainBuzzer = &_mainBuzzer; + struct Adc* const adc1 = &_adc1; struct AdcParameters* adc1Parameters = &_adc1Parameters; @@ -349,20 +358,20 @@ static ErrorStatus initIO (void) // Init LED Orange on DevKit ledInternOrange->gpio = configureGPIO(GPIOC, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_7); // Init LED Green of BiColour led - ledBicolourGreen->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource11); + ledBicolourGreen->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_11); // Init LED Red of BiColour led - ledBicolourRed->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource13); + ledBicolourRed->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_13); /* BUZZER initialisation -------------------------------------------------*/ - buzzer->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource12); + buzzer->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_12); /* HIGH VOLTAGE PRESENT initialisation -----------------------------------*/ // HV0 Present - hv0Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource12); + hv0Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_12); // HV1 Present - hv1Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource13); + hv1Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_13); // HV2 Present - hv2Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource14); + hv2Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_4); /* ADC1 initialisation ---------------------------------------------------*/ // Channel 0 - PA0 @@ -654,6 +663,9 @@ static ErrorStatus initPeriphery(void) // Solenoid GPIO_construct(solenoid, OUTPUT, solenoid->gpio); + // Buzzer + GPIO_construct(buzzer, OUTPUT, buzzer->gpio); + // HV detection GPIO_construct(hv0Present, INPUT, hv0Present->gpio); GPIO_construct(hv1Present, INPUT, hv1Present->gpio); @@ -814,6 +826,14 @@ static ErrorStatus initPlatformDevices (void) } } + /* --------------------------------------------------------------------*/ + /* SIMPLE IO BUZZER */ + /* --------------------------------------------------------------------*/ + if (returnValue == SUCCESS) + { + returnValue = Buzzer_construct(mainBuzzer, buzzer, BUZZER_TASK_PRIORITY, BUZZER_STACK_SIZE); + } + return returnValue; } diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile index 95bb840..c84460b 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/Makefile @@ -27,6 +27,7 @@ MenuCore.o \ MenuElements.o \ PIDParameters.o \ PIN.o \ +PowerLossDetector.o \ repairMenu.o \ repairMenus.o \ RepairPreset.o \ diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/Error.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/Error.h index e53c005..1f59a29 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/Error.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/Error.h @@ -48,6 +48,7 @@ typedef enum { + ERROR_POWER_LOSS, GPIO_FAIL, INTERLOCK_COMMON_FAIL, POWERENABLE_FAIL, diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuCore.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuCore.h index 4bb1691..865f8d8 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuCore.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuCore.h @@ -35,6 +35,7 @@ #include "stm32f10x.h" +#include "Buzzer.h" #include "Display.h" #include "KeyboardDevice.h" #include "MenuStates.h" @@ -44,7 +45,7 @@ #define MENUCORE_MAX_NUMBER_OF_ROWS (11) #define MENUCORE_MAX_NUMBER_OF_KEYS (16) -#define MENUCORE_DISPLAY_ROW_LENGTH (20) +#define MENUCORE_DISPLAY_ROW_LENGTH (21) // ----------------------------------------------------------------------------- // Type definitions. @@ -100,6 +101,7 @@ struct MenuCore struct MenuPage menuArray[RM_NUMBER_OF_MENUS]; struct Display* display; struct KeyboardDevice* keyboardDevice; + struct Buzzer* buzzer; char errorMessage[MENUCORE_DISPLAY_ROW_LENGTH + 1]; char warningMessage[MENUCORE_DISPLAY_ROW_LENGTH + 1]; TaskHandle_t taskHandle; @@ -130,6 +132,8 @@ struct MenuCore * @param self Menu core object to construct * @param display Display device to use for output * @param keyboardDevice KeyboardDevice for menu input + * @param buzzer A buzzer that gives audible feedback + * when a VALID key is pressed * @param taskPriority Priority for the menu task * @param stacksize Task stacksize * @param createMenu Functionpointer to a function that @@ -149,7 +153,7 @@ struct MenuCore * @todo * ----------------------------------------------------------------------------- */ -extern ErrorStatus MenuCore_construct(struct MenuCore* self, struct Display* display, struct KeyboardDevice* keyboardDevice, int taskPriority, uint16_t stackSize, MenuCoreFunctionCall createMenu, MenuCoreFunctionCall stateHandle); +extern ErrorStatus MenuCore_construct(struct MenuCore* self, struct Display* display, struct KeyboardDevice* keyboardDevice, struct Buzzer* buzzer, int taskPriority, uint16_t stackSize, MenuCoreFunctionCall createMenu, MenuCoreFunctionCall stateHandle); /** ---------------------------------------------------------------------------- diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuText.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuText.h index 628abd9..e9af1e5 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuText.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/MenuText.h @@ -61,7 +61,7 @@ static const char MenuText_WARNING[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_P "!!WARNING!!" }, { - //FRENCH TBW + "!!ATTENTION!!" } }; @@ -72,7 +72,7 @@ static const char MenuText_WARNING_COVER_OPEN[MENUTEXT_NUMBER_OF_LANGUAGES][MENU "COVER OPEN" }, { - //FRENCH TBW + "CAPOT OUVERT" } }; @@ -87,7 +87,7 @@ static const char MenuText_ERROR[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ROW1_POP "!!ERROR!!" }, { - //FRENCH TBW + "ERREUR!!" } }; @@ -98,10 +98,20 @@ static const char MenuText_ERROR_COVER_OPEN[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTE "COVER OPEN" }, { - //FRENCH TBW + "CAPOT OUVERT" } }; +static const char MenuText_ERROR_POWER_LOSS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] = +{ + // MAX 20 CHARACTERS + { + "POWERLOSS DETECTED" + }, + { + //FRENCH TBW + } +}; static const char MenuText_ERROR_PROCESS_FAILED[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POPUP_MESSAGE_LENGTH] = { @@ -110,7 +120,7 @@ static const char MenuText_ERROR_PROCESS_FAILED[MENUTEXT_NUMBER_OF_LANGUAGES][ME "PROCESS FAILED" }, { - //FRENCH TBW + "PROCESS ECHOUE" } }; @@ -121,7 +131,7 @@ static const char MenuText_ERROR_CRC_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ "PIN CRC ERROR" }, { - //FRENCH TBW + "ERREUR PIN CRC" } }; @@ -132,7 +142,7 @@ static const char MenuText_ERROR_CRC_PARAMETERS[MENUTEXT_NUMBER_OF_LANGUAGES][ME "PARAMETERS CRC ERROR" }, { - //FRENCH TBW + "ERREUR PARAMETRE CRC" } }; @@ -143,7 +153,7 @@ static const char MenuText_ERROR_CRC_PRESETS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUT "PRESETS CRC ERROR" }, { - //FRENCH TBW + "ERREUR PREREGL. CRC" } }; @@ -158,7 +168,7 @@ static const char MenuText_X_CONTINUE[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POP "Hit X to continue" }, { - //FRENCH TBW + "Continuer : touche X" } }; @@ -172,7 +182,10 @@ static const char MenuText_REPAIR_SCREEN[MENUTEXT_NUMBER_OF_LANGUAGES][4][MENUTE "ERROR" // Error identifier in case a ROW is in error-state. Will be written instead of the current voltage }, { - //FRENCH TBW + "total", + "reste", + "R", + "ERREUR" } }; @@ -183,7 +196,7 @@ static const char MenuText_REPAIR_SCREEN_INIT[MENUTEXT_NUMBER_OF_LANGUAGES][MENU "Initialising" // Indicates start of a repair }, { - //FRENCH TBW + "Initialisation" } }; @@ -198,7 +211,11 @@ static const char MenuText_PAUSE[MENUTEXT_NUMBER_OF_LANGUAGES][5][MENUTEXT_POPUP "Hit X to RESET" }, { - //FRENCH TBW + "TRAITEMENT EN COURS", + "Pause : touche x", + "!!PAUSE!!", + "Continuer: ENTREE", + "Réinit : touche X" } }; @@ -210,7 +227,8 @@ static const char MenuText_FINISH[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_POPU "Hit ENT to continue", }, { - //FRENCH TBW + "TRAITEMENT TERMINE", + "Continuer : ENTREE" } }; @@ -225,7 +243,11 @@ static const char MenuText_PRINT_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][5][MENUTEX "Volt:" }, { - //FRENCH TBW + "Preset", + "info", + "Start:", + "Temps:", + "Volt:" } }; @@ -237,7 +259,8 @@ static const char MenuText_CHANGE_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_ " Repeat PIN:" }, { - //FRENCH TBW + " Nouveau PIN:", + "Confirmer PIN:" } }; @@ -250,7 +273,9 @@ static const char MenuText_INTERLOCK_STATUS[MENUTEXT_NUMBER_OF_LANGUAGES][3][MEN "open" }, { - //FRENCH TBW + "Le capot est :", + "ferme", + "ouvert" } }; @@ -262,7 +287,8 @@ static const char MenuText_CONFIRM_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT "PIN DENIED" }, { - //FRENCH TBW + "PIN OK", + "PIN REFUSE" } }; @@ -274,7 +300,8 @@ static const char MenuText_CONFIRM_NEW_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENU "New PIN denied" }, { - //FRENCH TBW + "Nouveau PIN accepté", + "Nouveau PIN refusé" } }; @@ -285,7 +312,7 @@ static const char MenuText_SAFE_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_PO "Preset saved" }, { - //FRENCH TBW + "Prérégl. sauvegardé" } }; @@ -296,7 +323,7 @@ static const char MenuText_SELECT_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_ "Selected preset:" }, { - //FRENCH TBW + "Préréglage n° :" } }; @@ -308,7 +335,7 @@ static const char MenuText_SAFE_CONSTANTS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT "Constants saved" }, { - //FRENCH TBW + "Valeurs sauvegardées" } }; @@ -319,7 +346,7 @@ static const char MenuText_INSERT_PIN[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_POP "Insert PIN" }, { - //FRENCH TBW + "Ecrire PIN" } }; @@ -330,7 +357,7 @@ static const char MenuText_VOLTAGE_IN_HEADER[MENUTEXT_NUMBER_OF_LANGUAGES][MENUT "Get voltage in" }, { - //FRENCH TBW + "Lecture tension" } }; @@ -341,7 +368,7 @@ static const char MenuText_VOLTAGE_OUT_HEADER[MENUTEXT_NUMBER_OF_LANGUAGES][MENU "Set voltage out" }, { - //FRENCH TBW + "Réglage tension" } }; @@ -352,7 +379,7 @@ static const char MenuText_VOLTAGE_ROW[MENUTEXT_NUMBER_OF_LANGUAGES][5] = "Row" }, { - //FRENCH TBW + "Ligne" } }; @@ -363,7 +390,7 @@ static const char MenuText_CONSTANTS_HEADER[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTE "PID constants" }, { - //FRENCH TBW + "Valeurs du PID" } }; @@ -375,7 +402,8 @@ static const char MenuText_VOLTAGE_OUT_CLEANUP[MENUTEXT_NUMBER_OF_LANGUAGES][2][ "Press X to continue" }, { - //FRENCH TBW + "Ttes les lignes à 0V", + "Continuer : touche X" } }; @@ -392,7 +420,10 @@ static const char MenuText_MAINMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX_N " 3.Calibration" }, { - //FRENCH TBW + "", + " 1.Traitement tubes", + " 2.Mode Admin", + " 3.Mode Calibration" } }; @@ -405,7 +436,9 @@ static const char MenuText_CATHODEMCP_SELECT[MENUTEXT_NUMBER_OF_LANGUAGES][MENUC " 2.MCP repair", }, { - //FRENCH TBW + "Traitement tubes", + " 1.Traitement Pk", + " 2.Traitement GMC" } }; @@ -418,7 +451,9 @@ static const char MenuText_ADMIN_CATHODEMCP_SELECT[MENUTEXT_NUMBER_OF_LANGUAGES] " 2.MCP", }, { - //FRENCH TBW + "Mode Administrateur", + " 1.Photocathode", + " 2.GMC" } }; @@ -432,7 +467,9 @@ static const char MenuText_REPAIRMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX " 2.Start", }, { - //FRENCH TBW + "Traitement tubes", + " 1.Sélection prérég", + " 2.Démarrer" } }; @@ -453,7 +490,17 @@ static const char MenuText_PRESETMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX " 9.Preset 9", }, { - //FRENCH TBW + "Sélection préréglage", + " 1.Préréglage n°1", + " 2.Préréglage n°2", + " 3.Préréglage n°3", + " 4.Préréglage n°4", + " 5.Préréglage n°5", + " 6.Préréglage n°6", + " 7.Préréglage n°7", + " 8.Préréglage n°8", + " 9.Préréglage n°9", + } }; @@ -475,7 +522,12 @@ static const char MenuText_ADMINMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX_ " 5.Info & Version", }, { - //FRENCH TBW + "Mode Administrateur", + " 1.Modifier PIN", + " 2.Contrôle des E/S", + " 3.Config. Prérégl.", + " 4.Valeurs du PID", + " 5.Info & Version" } }; @@ -487,7 +539,7 @@ static const char MenuText_ADMINCHANGEPINMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENU "Change PIN", }, { - //FRENCH TBW + "Modifier PIN" } }; @@ -504,7 +556,12 @@ static const char MenuText_ADMINIOMAINMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCOR " 5.Teslagun relais", }, { - //FRENCH TBW + "Contrôle des E/S", + " 1.Interlock", + " 2.Solénoïdes", + " 3.Lecture tension", + " 4.Réglage tension", + " 5.Relai TeslaGun" } }; @@ -517,7 +574,7 @@ static const char MenuText_ADMINIOINTERLOCKMENU[MENUTEXT_NUMBER_OF_LANGUAGES][ME "Read interlock", }, { - //FRENCH TBW + "Lecture interlock" } }; @@ -533,24 +590,8 @@ static const char MenuText_ADMINSOLENOIDMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUC }, { - //FRENCH TBW - } -}; - - -// Administration Get Voltage output screen -static const char MenuText_ADMINVOLTAGOUTMAINMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX_NUMBER_OF_ROWS][MENUCORE_DISPLAY_ROW_LENGTH] = -{ - // MAX 20 CHARACTERS - MIND THE TWO BLANKS AT STRING START - THIS IS WHERE THE CURSOR IS PUT - { - "Set voltage out", - " 1.Channel 1", - " 2.Channel 2", - " 3.Channel 3", - - }, - { - //FRENCH TBW + "Solénoïdes", + "Basculer : touche 0" } }; @@ -566,7 +607,8 @@ static const char MenuText_ADMINTESLAGUNMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUC }, { - //FRENCH TBW + "Relai du TeslaGun", + "Basculer : touche 0" } }; @@ -588,7 +630,16 @@ static const char MenuText_ADMINPRESETCONFIGSELECTMENU[MENUTEXT_NUMBER_OF_LANGUA " 9.Preset 9 config", }, { - //FRENCH TBW + "Config. Prérégl.", + " 1 Prérégl 1 config", + " 2 Prérégl 2 config", + " 3 Prérégl 3 config", + " 4 Prérégl 4 config", + " 5 Prérégl 5 config", + " 6 Prérégl 6 config", + " 7 Prérégl 7 config", + " 8 Prérégl 8 config", + " 9 Prérégl 9 config", } }; @@ -601,7 +652,7 @@ static const char MenuText_ADMININFOMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_ "Info & Version", }, { - //FRENCH TBW + "Info & Version", } }; @@ -614,11 +665,12 @@ static const char MenuText_CALIBRATIONMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCOR // MAX 20 CHARACTERS - MIND THE TWO BLANKS AT STRING START - THIS IS WHERE THE CURSOR IS PUT { "Calibration", - " 1.NOTHING YET", + " 1.To be written", }, { - //FRENCH TBW + "Calibration", + " 1.En construction" } }; diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/PowerLossDetector.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/PowerLossDetector.h new file mode 100644 index 0000000..6b1bdda --- /dev/null +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/PowerLossDetector.h @@ -0,0 +1,118 @@ +// ----------------------------------------------------------------------------- +/// @file PowerLossDetector.h +/// @brief File 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) 2015 Micro-Key bv +// ----------------------------------------------------------------------------- + +/// @defgroup {group_name} {group_description} +/// Description + +/// @file PowerLossDetector.h +/// @ingroup {group_name} + +#ifndef POWERLOSSDETECTOR_H_ +#define POWERLOSSDETECTOR_H_ + + +// ----------------------------------------------------------------------------- +// Include files +// ----------------------------------------------------------------------------- + +#include "stm32f10x.h" + +#include "CachedStorage.h" +#include "MemoryDevice.h" + +// ----------------------------------------------------------------------------- +// Constant and macro definitions +// ----------------------------------------------------------------------------- + + + +// ----------------------------------------------------------------------------- +// Type definitions. +// ----------------------------------------------------------------------------- + + + +// ----------------------------------------------------------------------------- +// Function declarations +// ----------------------------------------------------------------------------- + + +/** ---------------------------------------------------------------------------- + * PowerLossDetector_construct + * Description of function + * + * @param memoryDevice + * + * @return ErrorStatus + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern ErrorStatus PowerLossDetector_construct(struct MemoryDevice* memoryDevice, unsigned int pageNumber, unsigned int startAddress, unsigned int length); + + +/** ---------------------------------------------------------------------------- + * PowerLossDetector_destruct + * Description of function + * + * + * @return void + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern void PowerLossDetector_destruct(void); + + +/** ---------------------------------------------------------------------------- + * PowerLossDetector_setBusyFlag + * Description of function + * + * @return void + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern void PowerLossDetector_setBusyFlag(void); + + +/** ---------------------------------------------------------------------------- + * PowerLossDetector_clearBusyFlag + * Description of function + * + * @return void + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern void PowerLossDetector_clearBusyFlag(void); + + +/** ---------------------------------------------------------------------------- + * PowerLossDetection_isFlagSet + * Description of function + * + * @return bool + * + * @todo + * ----------------------------------------------------------------------------- + */ +extern bool PowerLossDetection_isFlagSet(void); + +#endif /* POWERLOSSDETECTOR_H_ */ diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h index b81d113..7afe031 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/hsb-mrts.h @@ -54,8 +54,6 @@ #define HSB_MAINREPR_OOL_DURATION (20) #define HSB_MAINREPR_OOL_VALUE (300) -#define HSB_SECURITY_VOLTAGE_THRESHOLD (100) - #define HSB_ADC_ANODE_MIN_VOLTAGE (0) #define HSB_ADC_ANODE_MAX_VOLTAGE (10042) #define HSB_ADC_CMCP_MIN_VOLTAGE (0) @@ -72,7 +70,6 @@ // FLASH ADDRESSES FOR DATA STORAGE - // Define storage for presets, which is the biggest storage part // Each set of presets is written/saved on a dedicated page. This reduces // cache size when erasing page prior to write @@ -91,8 +88,9 @@ #define APP_FLASH_STORAGE_PARAMETERS (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_PARAMETERS_PAGE) // Define storage for power-down detection flag -#define APP_FLASH_POWERDOWN_PAGE (127) -#define APP_FLASH_STORAGE_POWERDOWN (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_POWERDOWN_PAGE) +#define APP_FLASH_POWERLOSS_PAGE (127) +#define APP_FLASH_STORAGE_POWERLOSS (INTERNAL_FLASH_BASE_ADDRESS + INTERNAL_FLASH_PAGE_SIZE * APP_FLASH_POWERLOSS_PAGE) +#define APP_FLASH_POWERLOSS_PAGESIZE (INTERNAL_FLASH_PAGE_SIZE) diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairMenu.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairMenu.h index 522b695..b06d918 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairMenu.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairMenu.h @@ -163,6 +163,9 @@ extern void repairMenu_interlockWarning(struct RepairMenu* self, T_INTERLOCK_ID extern void repairMenu_interlockFailed(struct RepairMenu* self, T_INTERLOCK_ID interlockID); +extern void repairMenu_powerLossDetected(struct RepairMenu* self); + + extern void repairMenu_processFailed(struct RepairMenu* self); diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairProcesses.h b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairProcesses.h index b228b26..d0bdda1 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairProcesses.h +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/inc/repairProcesses.h @@ -46,7 +46,7 @@ // Type definitions. // ----------------------------------------------------------------------------- - +extern struct RepairProcess* const rp; // ----------------------------------------------------------------------------- // Function declarations diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/MenuCore.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/MenuCore.c index 683605a..aae6639 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/MenuCore.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/MenuCore.c @@ -68,7 +68,7 @@ static void MenuCore_scrollDownIndexHandler(struct MenuCore* self); // ----------------------------------------------------------------------------- -ErrorStatus MenuCore_construct(struct MenuCore* self, struct Display* display, struct KeyboardDevice* keyboardDevice, int taskPriority, uint16_t stackSize, MenuCoreFunctionCall createMenu, MenuCoreFunctionCall stateHandle) +ErrorStatus MenuCore_construct(struct MenuCore* self, struct Display* display, struct KeyboardDevice* keyboardDevice, struct Buzzer* buzzer, int taskPriority, uint16_t stackSize, MenuCoreFunctionCall createMenu, MenuCoreFunctionCall stateHandle) { ErrorStatus returnValue = SUCCESS; @@ -98,6 +98,18 @@ ErrorStatus MenuCore_construct(struct MenuCore* self, struct Display* display, s } } + if (returnValue == SUCCESS) + { + if (buzzer->initialized) + { + self->buzzer = buzzer; + } + else + { + returnValue = ERROR; + } + } + if (returnValue == SUCCESS) { // Let Task run as soon as it has been created @@ -225,6 +237,12 @@ static ErrorStatus MenuCore_performAction(struct MenuCore* self, char key, Keypa struct KeyActionBinding keyAction = MenuCore_findKeyAction(self, key, keyState); + if (keyAction.action != NO_ACTION) + { + // Give audible feedback of valid key + BUZZER_KEYPAD_ACKNOWLEDGE(self->buzzer); + } + switch (keyAction.action) { case NO_ACTION: diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/PowerLossDetector.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/PowerLossDetector.c new file mode 100644 index 0000000..9960993 --- /dev/null +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/PowerLossDetector.c @@ -0,0 +1,199 @@ +// ----------------------------------------------------------------------------- +/// @file PowerLossDetector.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 PowerLossDetector.c +/// @ingroup {group_name} + + +// ----------------------------------------------------------------------------- +// Include files +// ----------------------------------------------------------------------------- + +#include "FreeRTOS.h" +#include "task.h" + +#include "PowerLossDetector.h" + +#include "Logger.h" + +// ----------------------------------------------------------------------------- +// Constant and macro definitions +// ----------------------------------------------------------------------------- + +#define PLD_MASK_FREE (0xFFFFFFFF) +#define PLD_MASK_BUSY (0xDEADC01A) +#define PLD_MASK_USED (0x00000000) + +// ----------------------------------------------------------------------------- +// Type definitions +// ----------------------------------------------------------------------------- + +struct PowerLossDetector +{ + bool initialized; + bool loaded; + unsigned int pageNumber; + unsigned int startAddress; + unsigned int length; + struct MemoryDevice* memoryDevice; +}; + +// ----------------------------------------------------------------------------- +// File-scope variables +// ----------------------------------------------------------------------------- + +static struct PowerLossDetector _plDetector = {.initialized = false, .loaded = false}; +struct PowerLossDetector* const plDetector = &_plDetector; + +// ----------------------------------------------------------------------------- +// Function declarations +// ----------------------------------------------------------------------------- + + + +// ----------------------------------------------------------------------------- +// Function definitions +// ----------------------------------------------------------------------------- + +ErrorStatus PowerLossDetector_construct(struct MemoryDevice* memoryDevice, unsigned int pageNumber, unsigned int startAddress, unsigned int length) +{ + ErrorStatus returnValue = SUCCESS; + + if (!plDetector->initialized) + { + if (returnValue == SUCCESS) + { + plDetector->pageNumber = pageNumber; + plDetector->startAddress = startAddress; + plDetector->length = length; + } + + if (returnValue == SUCCESS) + { + if (memoryDevice != NULL) + { + if (memoryDevice->initialized) + { + plDetector->memoryDevice = memoryDevice; + plDetector->initialized = true; + LOGGER_DEBUG(mainLog, "PowerLossDetector constructed"); + } + else + { + returnValue = ERROR; + } + } + else + { + returnValue = ERROR; + } + } + } + else + { + returnValue = ERROR; + } + + return returnValue; +} + + + +extern void PowerLossDetector_destruct(void) +{ + plDetector->initialized = false; +} + + +void PowerLossDetector_setBusyFlag(void) +{ + bool freeAddressFound = false; + uint32_t buffer; + unsigned int flagAddress; + unsigned int loopcounter; + // Find the first available free address + for (loopcounter = plDetector->startAddress; loopcounter < (plDetector->startAddress + plDetector->length); loopcounter += 4) + { + MemoryDevice_read(plDetector->memoryDevice, &buffer, loopcounter, 1); + if (buffer == PLD_MASK_FREE) + { + // Found free space + flagAddress = loopcounter; + freeAddressFound = true; + LOGGER_DEBUG(mainLog, "Found free address at: %X", loopcounter); + break; + } + } + + // In case no free address has been found, the complete page must be cleared + // After clearing, the address to write the busy flag to is equal to the start address + if (!freeAddressFound) + { + MemoryDevice_erasePage(plDetector->memoryDevice, plDetector->pageNumber); + flagAddress = plDetector->startAddress; + } + + buffer = PLD_MASK_BUSY; + MemoryDevice_write(plDetector->memoryDevice, &buffer, flagAddress, 1); + +} + + +extern void PowerLossDetector_clearBusyFlag(void) +{ + uint32_t buffer; + unsigned int loopcounter; + // Find the first available free address + for (loopcounter = plDetector->startAddress; loopcounter < (plDetector->startAddress + plDetector->length); loopcounter += 4) + { + MemoryDevice_read(plDetector->memoryDevice, &buffer, loopcounter, 1); + if (buffer == PLD_MASK_BUSY) + { + // Found the busy flag + buffer = PLD_MASK_USED; + LOGGER_DEBUG(mainLog, "Found busyFlag at address %X", loopcounter); + MemoryDevice_write(plDetector->memoryDevice, &buffer, loopcounter, 1); + break; + } + } +} + + +bool PowerLossDetection_isFlagSet(void) +{ + bool returnValue = false; + + uint32_t buffer; + unsigned int loopcounter; + // Find the first available free address + + for (loopcounter = plDetector->startAddress; loopcounter < (plDetector->startAddress + plDetector->length); loopcounter += 4) + { + MemoryDevice_read(plDetector->memoryDevice, &buffer, loopcounter, 1); + if (buffer == PLD_MASK_BUSY) + { + // Found the busy flag + returnValue = true; + LOGGER_DEBUG(mainLog, "Found busyFlag at address %X", loopcounter); + break; + } + } + + return returnValue; +} diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/hsb-mrts.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/hsb-mrts.c index 4244017..69dbc56 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/hsb-mrts.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/hsb-mrts.c @@ -81,6 +81,8 @@ ErrorStatus hsb_generateStartScreen(struct Display* Display) if (returnValue == SUCCESS) { + Display_setCursorToPosition(mainDisplay, 1, 1); + vTaskDelay(10); returnValue = Display_write(mainDisplay, PCBA_getInstance()->name, 1, 1); } else @@ -116,29 +118,29 @@ ErrorStatus hsb_enableSafetyWithError(void) CoverSolenoid_lock(); } - if (returnValue == SUCCESS) - { - // Check for INTERLOCK CLOSE - if (Interlock_isClosed(interlock)) - { - // Enable Interrupt for interlock switch - Interlock_setEXTI(interlock, ENABLE); - } - else - { - Error_postError(INTERLOCK_COMMON_FAIL); - returnValue = ERROR; - } - } - - if (returnValue == SUCCESS) - { - // In case of a TESLA repair, release the teslaGunSafety - if (PCBA_getInstance()->pcba == PCBA_Tesla) - { - TeslaGunSafety_release(); - } - } +// if (returnValue == SUCCESS) +// { +// // Check for INTERLOCK CLOSE +// if (Interlock_isClosed(interlock)) +// { +// // Enable Interrupt for interlock switch +// Interlock_setEXTI(interlock, ENABLE); +// } +// else +// { +// Error_postError(INTERLOCK_COMMON_FAIL); +// returnValue = ERROR; +// } +// } +// +// if (returnValue == SUCCESS) +// { +// // In case of a TESLA repair, release the teslaGunSafety +// if (PCBA_getInstance()->pcba == PCBA_Tesla) +// { +// TeslaGunSafety_release(); +// } +// } if (returnValue == SUCCESS) { @@ -162,29 +164,29 @@ ErrorStatus hsb_enableSafetyWithWarning(void) CoverSolenoid_lock(); } - if (returnValue == SUCCESS) - { - // Check for INTERLOCK CLOSE - if (Interlock_isClosed(interlock)) - { - // Enable Interrupt for interlock switch - Interlock_setEXTI(interlock, ENABLE); - } - else - { - Warning_postWarning(WARNING_INTERLOCK_COMMON_FAIL); - returnValue = ERROR; - } - } - - if (returnValue == SUCCESS) - { - // In case of a TESLA repair, release the teslaGunSafety - if (PCBA_getInstance()->pcba == PCBA_Tesla) - { - TeslaGunSafety_release(); - } - } +// if (returnValue == SUCCESS) +// { +// // Check for INTERLOCK CLOSE +// if (Interlock_isClosed(interlock)) +// { +// // Enable Interrupt for interlock switch +// Interlock_setEXTI(interlock, ENABLE); +// } +// else +// { +// Warning_postWarning(WARNING_INTERLOCK_COMMON_FAIL); +// returnValue = ERROR; +// } +// } +// +// if (returnValue == SUCCESS) +// { +// // In case of a TESLA repair, release the teslaGunSafety +// if (PCBA_getInstance()->pcba == PCBA_Tesla) +// { +// TeslaGunSafety_release(); +// } +// } if (returnValue == SUCCESS) { @@ -202,29 +204,22 @@ ErrorStatus hsb_disableSafety(void) { ErrorStatus returnValue = SUCCESS; - int adcR1Value = HSB_SECURITY_VOLTAGE_THRESHOLD; - int adcR2Value = HSB_SECURITY_VOLTAGE_THRESHOLD; - int adcR3Value = HSB_SECURITY_VOLTAGE_THRESHOLD; - if (PCBA_getInstance()->pcba == PCBA_Tesla) { TeslaGunSafety_block(); } -// Display_clearScreen(mainDisplay); - char buffer[mainDisplay->displayDevice->parameters.numberOfColumns]; - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "WAITING FOR"); - Display_write(mainDisplay, buffer, 3, 5); - - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "POWER DOWN"); - Display_write(mainDisplay, buffer, 4, 6); - - // Power-down the DAC outputs DAConverter_setOutputVoltage(dacRow1, 0); DAConverter_setOutputVoltage(dacRow2, 0); DAConverter_setOutputVoltage(dacRow3, 0); + char buffer[mainDisplay->displayDevice->parameters.numberOfColumns]; + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "WAITING FOR"); + Display_write(mainDisplay, buffer, 3, 5); + + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "POWER DOWN"); + Display_write(mainDisplay, buffer, 4, 6); while (HighVoltageDetection_isVoltagePresent()) { diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c index 78239f2..7a970b7 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/main.c @@ -44,8 +44,10 @@ #include "Error.h" #include "hsb-mrts.h" #include "hwValidationMenu.h" +#include "PowerLossDetector.h" #include "repairMenu.h" #include "repairMenus.h" +#include "repairProcesses.h" #include "Warning.h" #include "CathodeMCP.h" @@ -150,7 +152,7 @@ static void printSystemInfoTask(void* parameters) { LOGGER_INFO(mainLog, "---------------------------------------"); systeminfoCommandHandler(); - vTaskDelay(20000); + vTaskDelay(10000); } } @@ -173,9 +175,14 @@ static ErrorStatus systeminfoCommandHandler(void) vTaskDelay(10); OS_logTaskInfo(mainMenu->menuCore->taskHandle); vTaskDelay(10); + OS_logTaskInfo(rp->taskHandle); + vTaskDelay(10); OS_logTaskInfo(mainDisplay->taskHandle); vTaskDelay(10); OS_logTaskInfo(errorTaskHandle); + vTaskDelay(10); + OS_logTaskInfo(mainBuzzer->taskHandle); + @@ -189,13 +196,13 @@ static void initTask(void* parameters) if (returnValue == SUCCESS) { // Create the error handler - Error_construct(); + returnValue = Error_construct(); } if (returnValue == SUCCESS) { // Create the warning handler - Warning_construct(); + returnValue = Warning_construct(); } if (returnValue == SUCCESS) @@ -204,30 +211,36 @@ static void initTask(void* parameters) // All IO is initialized here // Also, all periphery and platform-specifics are initialized here // IRQs are defined here - initPlatform(); + returnValue = initPlatform(); } if (returnValue == SUCCESS) { // Construct the displays - Displays_construct(); + returnValue = Displays_construct(); + } + + if (returnValue == SUCCESS) + { + // Construct the powerloss detector + returnValue = PowerLossDetector_construct(&iFlash->memoryDevice, APP_FLASH_POWERLOSS_PAGE, APP_FLASH_STORAGE_POWERLOSS, APP_FLASH_POWERLOSS_PAGESIZE); } if (returnValue == SUCCESS) { // Construct the AD Converters - ADConverters_construct(); + returnValue = ADConverters_construct(); } if (returnValue == SUCCESS) { // Construct the DA Converters - DAConverters_construct(); + returnValue = DAConverters_construct(); } if (returnValue == SUCCESS) { - hsb_generateStartScreen(mainDisplay); + returnValue = hsb_generateStartScreen(mainDisplay); // Let start screen stay for 5 seconds vTaskDelay(INIT_START_SCREEN_DELAY); } @@ -235,13 +248,13 @@ static void initTask(void* parameters) if (returnValue == SUCCESS) { // Construct/Load the device parameters - DeviceParameters_construct(&deviceParameters, &iFlash->memoryDevice); + returnValue = DeviceParameters_construct(&deviceParameters, &iFlash->memoryDevice); } if (returnValue == SUCCESS) { // Construct the repair presets - RepairPresets_construct(&cs, &iFlash->memoryDevice); + returnValue = RepairPresets_construct(&cs, &iFlash->memoryDevice); } #ifdef ENABLE_HW_VALIDATION @@ -278,7 +291,16 @@ static void initTask(void* parameters) if (returnValue == SUCCESS) { // Construct the repair menu - repairMenus_construct(); + returnValue = repairMenus_construct(); + } + + if (PowerLossDetection_isFlagSet()) + { + LOGGER_ERROR(mainLog, "Powerloss detection triggered"); + Error_postError(ERROR_POWER_LOSS); + returnValue = ERROR; + // Flag may be restored now + PowerLossDetector_clearBusyFlag(); } // Delete this init task diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c index 21c3333..27affad 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c @@ -31,6 +31,7 @@ #include "DeviceParameters.h" #include "PIDParameters.h" +#include "PowerLossDetector.h" #include "repairMenu.h" #include "repairMenus.h" #include "RepairPreset.h" @@ -254,6 +255,13 @@ void repairMenu_interlockFailed(struct RepairMenu* self, T_INTERLOCK_ID interloc } +void repairMenu_powerLossDetected(struct RepairMenu* self) +{ + MenuCore_changeState(self->menuCore, RM_ERROR_STATE); + snprintf(self->menuCore->errorMessage, sizeof(self->menuCore->errorMessage) / sizeof(self->menuCore->errorMessage[0]), MenuText_ERROR_POWER_LOSS[languageIndex]); +} + + void repairMenu_processFailed(struct RepairMenu* self) { MenuCore_changeState(self->menuCore, RM_ERROR_STATE); @@ -1012,6 +1020,8 @@ static void repairMenu_startRepairProcess(struct MenuCore* self) { // repair process is running MenuCore_changeState(self, RM_REPAIR_RUNNING); + // Set Flag in FLASH + PowerLossDetector_setBusyFlag(); } else { @@ -1060,9 +1070,17 @@ static void repairMenu_gotoLastState(struct MenuCore* self) void repairMenu_menuStateHandle(struct MenuCore* self) { + // Stop the buzzer from recovered error or warning + if ((self->lastMenuState == RM_ERROR_STATE) || (self->lastMenuState == RM_WARNING_STATE)) + { + if ((self->menuState != RM_ERROR_STATE) && (self->menuState != RM_WARNING_STATE)) + Buzzer_stop(self->buzzer); + } + // Catch ERROR state if (self->menuState == RM_ERROR_STATE) { + self->lastMenuState = self->menuState; // Show ERROR message repairMenu_printError(self); // Handle error @@ -1073,6 +1091,7 @@ void repairMenu_menuStateHandle(struct MenuCore* self) } else if (self->menuState == RM_WARNING_STATE) { + self->lastMenuState = self->menuState; repairMenu_printWarning(self); } @@ -1119,6 +1138,7 @@ void repairMenu_menuStateHandle(struct MenuCore* self) else if (self->menuState == RM_FINISH_CONTROL) { repairMenu_stopRepairProcess(self); + PowerLossDetector_clearBusyFlag(); MenuCore_changeState(self, RM_FINISH); } else if (self->menuState == RM_FINISH) diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenus.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenus.c index b0a2a75..9c31ade 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenus.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenus.c @@ -36,6 +36,7 @@ #include "Warning.h" #include "platform.h" +#include "Buzzer.h" #include "Logger.h" #include "Observable.h" #include "rtc.h" @@ -82,13 +83,13 @@ ErrorStatus repairMenus_construct(void) if (returnValue == SUCCESS) { // Create the Menu core - returnValue = MenuCore_construct(menuCore, mainDisplay, &storm700->keyboardDevice, HSB_MAINMENU_TASK_PRIORITY, HSB_MAINMENU_TASK_STACKSIZE, repairMenu_createMenuEntries, repairMenu_menuStateHandle); + returnValue = MenuCore_construct(menuCore, mainDisplay, &storm700->keyboardDevice, mainBuzzer, HSB_MAINMENU_TASK_PRIORITY, HSB_MAINMENU_TASK_STACKSIZE, repairMenu_createMenuEntries, repairMenu_menuStateHandle); } if (returnValue == SUCCESS) { // Create first repair menu - returnValue = repairMenu_construct(mainMenu, menuCore,&iFlash->memoryDevice, repairMenus_freeMainMenuRepairScreenUpdateSemaphore); + returnValue = repairMenu_construct(mainMenu, menuCore, &iFlash->memoryDevice, repairMenus_freeMainMenuRepairScreenUpdateSemaphore); } if (returnValue == SUCCESS) @@ -124,9 +125,16 @@ static ErrorStatus repairMenus_errorReceive(const void* const data) switch (errorCode) { + case ERROR_POWER_LOSS: + { + repairMenu_powerLossDetected(mainMenu); + BUZZER_ERROR(mainBuzzer); + break; + } case INTERLOCK_COMMON_FAIL: { repairMenu_interlockFailed(mainMenu, COMMON_INTERLOCK); + BUZZER_ERROR(mainBuzzer); break; } case POWERENABLE_FAIL: @@ -136,6 +144,7 @@ static ErrorStatus repairMenus_errorReceive(const void* const data) case REPAIR_FAIL: { repairMenu_processFailed(mainMenu); + BUZZER_ERROR(mainBuzzer); break; } case ERROR_CRC_PIN: @@ -143,6 +152,7 @@ static ErrorStatus repairMenus_errorReceive(const void* const data) case ERROR_CRC_PRESETS: { repairMenu_printCRCFailure(mainMenu, errorCode); + BUZZER_ERROR(mainBuzzer); break; } default: @@ -163,6 +173,7 @@ static ErrorStatus repairMenus_warningReceive(const void* const data) case WARNING_INTERLOCK_COMMON_FAIL: { repairMenu_interlockWarning(mainMenu, COMMON_INTERLOCK); + BUZZER_WARNING(mainBuzzer); break; } diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c index e9e303a..f0e49af 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcess.c @@ -266,7 +266,7 @@ static void repairProcess_task(void* parameters) { // The current ADC value is outside the error boundaries self->row[loopCounter].errorData.outOfLimitsCounter += 1; - LOGGER_WARNING(mainLog, "Row %d outside boundaries", loopCounter); +// LOGGER_WARNING(mainLog, "Row %d outside boundaries", loopCounter); } else { @@ -282,7 +282,7 @@ static void repairProcess_task(void* parameters) // ROW is in error state self->row[loopCounter].lastDACValue = 0; DAConverter_setOutputVoltage(self->row[loopCounter].dacChannel, self->row[loopCounter].lastDACValue); - LOGGER_ERROR(mainLog, "Row %d --- Row in ERROR state", loopCounter); +// LOGGER_ERROR(mainLog, "Row %d --- Row in ERROR state", loopCounter); } } } diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcesses.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcesses.c index a400436..ca12aa7 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcesses.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairProcesses.c @@ -50,6 +50,7 @@ // ----------------------------------------------------------------------------- static struct RepairProcess mainRepairProcess; +struct RepairProcess* const rp = &mainRepairProcess; // ----------------------------------------------------------------------------- // Function declarations