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
This commit is contained in:
mmi
2017-12-13 13:22:06 +00:00
parent 9a5bbf8a7a
commit a48164fe7a
24 changed files with 973 additions and 160 deletions

View File

@@ -48,6 +48,7 @@
typedef enum
{
ERROR_POWER_LOSS,
GPIO_FAIL,
INTERLOCK_COMMON_FAIL,
POWERENABLE_FAIL,

View File

@@ -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);
/** ----------------------------------------------------------------------------

View File

@@ -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<EFBFBD>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<70>",
"Nouveau PIN refus<75>"
}
};
@@ -285,7 +312,7 @@ static const char MenuText_SAFE_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_PO
"Preset saved"
},
{
//FRENCH TBW
"Pr<EFBFBD>r<EFBFBD>gl. sauvegard<72>"
}
};
@@ -296,7 +323,7 @@ static const char MenuText_SELECT_PRESET[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT_
"Selected preset:"
},
{
//FRENCH TBW
"Pr<EFBFBD>r<EFBFBD>glage n<> :"
}
};
@@ -308,7 +335,7 @@ static const char MenuText_SAFE_CONSTANTS[MENUTEXT_NUMBER_OF_LANGUAGES][MENUTEXT
"Constants saved"
},
{
//FRENCH TBW
"Valeurs sauvegard<72>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<EFBFBD>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 <20> 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<70>r<EFBFBD>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<EFBFBD>lection pr<70>r<EFBFBD>glage",
" 1.Pr<50>r<EFBFBD>glage n<>1",
" 2.Pr<50>r<EFBFBD>glage n<>2",
" 3.Pr<50>r<EFBFBD>glage n<>3",
" 4.Pr<50>r<EFBFBD>glage n<>4",
" 5.Pr<50>r<EFBFBD>glage n<>5",
" 6.Pr<50>r<EFBFBD>glage n<>6",
" 7.Pr<50>r<EFBFBD>glage n<>7",
" 8.Pr<50>r<EFBFBD>glage n<>8",
" 9.Pr<50>r<EFBFBD>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<74>le des E/S",
" 3.Config. Pr<50>r<EFBFBD>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<EFBFBD>le des E/S",
" 1.Interlock",
" 2.Sol<6F>no<6E>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<EFBFBD>no<EFBFBD>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<50>r<EFBFBD>gl.",
" 1 Pr<50>r<EFBFBD>gl 1 config",
" 2 Pr<50>r<EFBFBD>gl 2 config",
" 3 Pr<50>r<EFBFBD>gl 3 config",
" 4 Pr<50>r<EFBFBD>gl 4 config",
" 5 Pr<50>r<EFBFBD>gl 5 config",
" 6 Pr<50>r<EFBFBD>gl 6 config",
" 7 Pr<50>r<EFBFBD>gl 7 config",
" 8 Pr<50>r<EFBFBD>gl 8 config",
" 9 Pr<50>r<EFBFBD>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"
}
};

View File

@@ -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_ */

View File

@@ -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)

View File

@@ -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);

View File

@@ -46,7 +46,7 @@
// Type definitions.
// -----------------------------------------------------------------------------
extern struct RepairProcess* const rp;
// -----------------------------------------------------------------------------
// Function declarations