Fixed multiple bugs and errors.
- Added WARNING handler - put voltage calculations to dedicated module fixed last errors. Updated menu repair screen without ERROR from PID This is version 0.9.0.3, which is used for the first duration test Will also be tagged git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@272 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -99,4 +99,7 @@ extern void ADConverter_destruct(struct ADConverter* self);
|
||||
*/
|
||||
extern int ADConverter_getInputVoltage(const struct ADConverter* self);
|
||||
|
||||
|
||||
extern unsigned int ADConverter_getInputConverterValue(const struct ADConverter* self);
|
||||
|
||||
#endif /* ADCONVERTER_H_ */
|
||||
|
||||
@@ -102,4 +102,18 @@ extern void DAConverter_destruct(struct DAConverter* self);
|
||||
extern ErrorStatus DAConverter_setOutputVoltage(const struct DAConverter* self, int voltage);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* DAConverter_getCurrentValue
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param
|
||||
* @return uint32_t
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern uint32_t DAConverter_getCurrentValue(const struct DAConverter* self);
|
||||
|
||||
|
||||
#endif /* DACONVERTER_H_ */
|
||||
|
||||
@@ -108,4 +108,19 @@ extern struct PIDParameters* DeviceParameters_getPIDParameters(void);
|
||||
*/
|
||||
extern struct PIN* DeviceParameters_getPIN(void);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* DeviceParameters_saveParameters
|
||||
* Description of function
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void DeviceParameters_saveParameters(void);
|
||||
|
||||
ErrorStatus DeviceParameters_writePIDParameters(struct PIDParameters* parameters);
|
||||
ErrorStatus DeviceParameters_writePIN(struct PIN* pin);
|
||||
|
||||
#endif /* DEVICEPARAMETERS_H_ */
|
||||
|
||||
@@ -52,6 +52,9 @@ typedef enum
|
||||
INTERLOCK_COMMON_FAIL,
|
||||
POWERENABLE_FAIL,
|
||||
REPAIR_FAIL,
|
||||
ERROR_CRC_PIN,
|
||||
ERROR_CRC_PARAMETERS,
|
||||
ERROR_CRC_PRESETS
|
||||
} T_ErrorCode;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -100,8 +100,8 @@ struct MenuCore
|
||||
struct MenuPage menuArray[RM_NUMBER_OF_MENUS];
|
||||
struct Display* display;
|
||||
struct KeyboardDevice* keyboardDevice;
|
||||
char errorMessage[MENUCORE_DISPLAY_ROW_LENGTH];
|
||||
char warningMessage[MENUCORE_DISPLAY_ROW_LENGTH];
|
||||
char errorMessage[MENUCORE_DISPLAY_ROW_LENGTH + 1];
|
||||
char warningMessage[MENUCORE_DISPLAY_ROW_LENGTH + 1];
|
||||
TaskHandle_t taskHandle;
|
||||
int TaskPriority;
|
||||
bool runTask;
|
||||
@@ -109,6 +109,7 @@ struct MenuCore
|
||||
int cursorIndex;
|
||||
int selectionIndex;
|
||||
int scrollOffset;
|
||||
char insertString[MENUCORE_DISPLAY_ROW_LENGTH + 1];
|
||||
int insertValue;
|
||||
uint32_t popUpCounter;
|
||||
MenuCoreFunctionCall _handleStateFunction;
|
||||
|
||||
@@ -71,8 +71,10 @@ typedef enum
|
||||
// ADMINISTRATION MENUs
|
||||
// --------------------------------------------------------------------------
|
||||
RM_ADMIN_CATHODEMCP_SELECT,
|
||||
RM_ADMINMENU_PIN_VERIFICATION,
|
||||
RM_ADMINMENU,
|
||||
RM_ADMIN_CHANGEPIN,
|
||||
RM_ADMIN_CHANGEPIN_FIRST_INSERT,
|
||||
RM_ADMIN_CHANGEPIN_SECOND_INSERT,
|
||||
RM_ADMIN_IOCONTROL,
|
||||
RM_ADMIN_PRESET_CONFIG_SELECT,
|
||||
RM_ADMIN_PRESET_CONFIG_FIRST_SOFTSTART,
|
||||
@@ -81,18 +83,25 @@ typedef enum
|
||||
RM_ADMIN_PRESET_CONFIG_SECOND_SOFTSTART,
|
||||
RM_ADMIN_PRESET_CONFIG_SECOND_DURATION,
|
||||
RM_ADMIN_PRESET_CONFIG_SECOND_VOLTAGE,
|
||||
RM_ADMIN_PID_CONFIG_KP,
|
||||
RM_ADMIN_PID_CONFIG_KI,
|
||||
RM_ADMIN_PID_CONFIG_KD,
|
||||
RM_ADMIN_INFO,
|
||||
|
||||
RM_ADMIN_IO_INTERLOCK,
|
||||
RM_ADMIN_IO_SOLENOID,
|
||||
RM_ADMIN_IO_VOLTAGE_IN,
|
||||
RM_ADMIN_IO_VOLTAGE_OUT,
|
||||
RM_ADMIN_IOCONTROL_VOLTAGE_OUT_CHANNEL1,
|
||||
RM_ADMIN_IOCONTROL_VOLTAGE_OUT_CHANNEL2,
|
||||
RM_ADMIN_IOCONTROL_VOLTAGE_OUT_CHANNEL3,
|
||||
RM_ADMIN_IOCONTROL_VOLTAGE_OUT_CLEANUP,
|
||||
RM_ADMIN_IO_TESLAGUN,
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// CALIBRATION MENUs
|
||||
// --------------------------------------------------------------------------
|
||||
RM_CALIBRATIONMENU_PIN_VERIFICATION,
|
||||
RM_CALIBRATIONMENU,
|
||||
|
||||
RM_ERROR_STATE,
|
||||
|
||||
@@ -126,7 +126,8 @@ static const char MenuText_ADMINMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX_
|
||||
" 1.Change Pin",
|
||||
" 2.I/O control",
|
||||
" 3.Preset config",
|
||||
" 4.Info & Version",
|
||||
" 4.PID constants",
|
||||
" 5.Info & Version",
|
||||
},
|
||||
{
|
||||
//FRENCH TBW
|
||||
@@ -188,22 +189,6 @@ static const char MenuText_ADMINSOLENOIDMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUC
|
||||
};
|
||||
|
||||
|
||||
// Administration Get Voltage input screen
|
||||
static const char MenuText_ADMINVOLTAGINMAINMENU[MENUTEXT_NUMBER_OF_LANGUAGES][MENUCORE_MAX_NUMBER_OF_ROWS][MENUCORE_DISPLAY_ROW_LENGTH] =
|
||||
{
|
||||
{
|
||||
"Get voltage in",
|
||||
" 1.Channel 1",
|
||||
" 2.Channel 2",
|
||||
" 3.Channel 3",
|
||||
|
||||
},
|
||||
{
|
||||
//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] =
|
||||
{
|
||||
|
||||
@@ -38,7 +38,11 @@
|
||||
|
||||
struct PIDParameters
|
||||
{
|
||||
|
||||
int Kp; // proportional constant
|
||||
int Ki; // integration constant
|
||||
int Kd; // differential constant
|
||||
int iMin;
|
||||
int iMax;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -51,5 +55,86 @@ struct PIDParameters
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIDParameters_generateDefaultParameters
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIDParameters_generateDefaultParameters(struct PIDParameters* self);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIDParameters_setKp
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param Kp
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIDParameters_setKp(struct PIDParameters* self, int Kp);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIDParameters_setKi
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param Ki
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIDParameters_setKi(struct PIDParameters* self, int Ki);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIDParameters_setKd
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param Kd
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIDParameters_setKd(struct PIDParameters* self, int Kd);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIDParameters_setiMin
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param Kp
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIDParameters_setiMin(struct PIDParameters* self, int iMin);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIDParameters_setiMax
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param Kp
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIDParameters_setiMax(struct PIDParameters* self, int iMax);
|
||||
#endif /* PIDPARAMETERS_H_ */
|
||||
|
||||
@@ -31,25 +31,93 @@
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "stm32f10x.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#define PIN_NUMBER_OF_DIGITS (4)
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
struct PIN
|
||||
{
|
||||
char firstDigit;
|
||||
char secondDigit;
|
||||
char thirdDigit;
|
||||
char fourthDigit;
|
||||
|
||||
char pinchangeFirstInsert[5];
|
||||
char pinchangeSecondInsert[5];
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIN_generateDefaultPIN
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIN_generateDefaultPIN(struct PIN* self);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIN_isOK
|
||||
* Description of function
|
||||
*
|
||||
* @param self
|
||||
* @param PinToVerify
|
||||
* @return bool
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern bool PIN_isOK(struct PIN* self, char* const pin);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIN_changePinFirstInsert
|
||||
* Transmits the first PIN insertion in order to change the current PIN
|
||||
*
|
||||
* @param self
|
||||
* @param firstPinInsert
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void PIN_changePinFirstInsert(struct PIN* self, char* const firstPinInsert);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* PIN_changePinSecondInsert
|
||||
* transmits the second PIN insertion in order to change the current PIN.
|
||||
* Only accepts second insert after first insert has been called. Afterwards,
|
||||
* both inserts a compared. If equal, the new PIN is registered. Otherwise an
|
||||
* error message is generated
|
||||
*
|
||||
* @param self
|
||||
* @param firstPinInsert
|
||||
* @return ErrorStatus SUCCESS if both PIN inserts are equal
|
||||
* ERROR otherwise
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus PIN_changePinSecondInsert(struct PIN* self, char* const secondPinInsert);
|
||||
|
||||
#endif /* PIN_H_ */
|
||||
|
||||
@@ -70,6 +70,8 @@ struct SignalProfileGenerator
|
||||
uint32_t startTime;
|
||||
uint32_t softStartTimer;
|
||||
uint32_t voltageHoldTimer;
|
||||
uint32_t totalStartTime;
|
||||
uint32_t totalRunTime;
|
||||
|
||||
int pauseStartVoltage;
|
||||
uint32_t pauseStartTime;
|
||||
@@ -103,8 +105,14 @@ extern void SignalProfileGenerator_pause(struct SignalProfileGenerator* self);
|
||||
extern bool SignalProfileGenerator_isPaused(struct SignalProfileGenerator* self);
|
||||
|
||||
|
||||
extern bool SignalProfileGenerator_isFinished(struct SignalProfileGenerator* self);
|
||||
|
||||
|
||||
extern void SignalProfileGenerator_continue(struct SignalProfileGenerator* self);
|
||||
|
||||
|
||||
extern uint32_t SignalProfileGenerator_getRemainingTime(const struct SignalProfileGenerator* self);
|
||||
|
||||
|
||||
extern uint32_t SignalProfileGenerator_getTotalRepairTime(const struct SignalProfileGenerator* self);
|
||||
#endif /* INC_SIGNALPROFILEGENERATOR_H_ */
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @file Voltage.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 Voltage.h
|
||||
/// @ingroup {group_name}
|
||||
|
||||
#ifndef VOLTAGE_H_
|
||||
#define VOLTAGE_H_
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include "stm32f10x.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
extern int Voltage_calculateVoltage(uint32_t value, uint32_t resolutionInBits, int minVoltage, int maxVoltage);
|
||||
|
||||
|
||||
extern uint32_t Voltage_calculateDeviceValue(int value, uint32_t resolutionInBits, int minVoltage, int maxVoltage);
|
||||
|
||||
|
||||
#endif /* VOLTAGE_H_ */
|
||||
@@ -31,22 +31,81 @@
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include "stm32f10x.h"
|
||||
|
||||
#include "Observable.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WARNING_INTERLOCK_COMMON_FAIL,
|
||||
} T_WarningCode;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Warning_construct
|
||||
* Constructs the Warning handler
|
||||
*
|
||||
* @return ErrorStatus SUCCESS if construction was successful
|
||||
* ERROR otherwise
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern ErrorStatus Warning_construct(void);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Warning_getObservable
|
||||
* Returns the observable of the Warning handler
|
||||
*
|
||||
* @return struct Observable* Observable of the Warning handler
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern struct Observable* Warning_getObservable(void);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Warning_postWarning
|
||||
* Posts a new Warning
|
||||
*
|
||||
* @param warningCode Warning CODE
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void Warning_postWarning(T_WarningCode warningCode);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Warning_postWarningFromISR
|
||||
* Posts a new Warning from an ISR context
|
||||
*
|
||||
* @param warningCode Warning CODE
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
extern void Warning_postWarningFromISR(T_WarningCode warningCode);
|
||||
|
||||
#endif /* WARNING_H_ */
|
||||
|
||||
@@ -123,8 +123,10 @@ extern struct Display* const mainDisplay;
|
||||
*/
|
||||
extern ErrorStatus hsb_generateStartScreen(struct Display* Display);
|
||||
|
||||
extern ErrorStatus hsb_enableSafetyWithError(void);
|
||||
|
||||
extern ErrorStatus hsb_enableSafetyWithWarning(void);
|
||||
|
||||
extern ErrorStatus hsb_enableSafety(void);
|
||||
extern ErrorStatus hsb_disableSafety(void);
|
||||
extern bool hsb_safetyIsEnabled(void);
|
||||
#endif /* HSB_MRTS_H_ */
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "semphr.h"
|
||||
|
||||
#include "stm32f10x.h"
|
||||
|
||||
#include "Error.h"
|
||||
#include "MenuCore.h"
|
||||
#include "RepairPreset.h"
|
||||
#include "repairProcess.h"
|
||||
@@ -142,6 +144,9 @@ extern void repairMenu_feedSecondsCounter(struct RepairMenu* self);
|
||||
extern void repairMenu_feedSecondsCounterFromISR(struct RepairMenu* self);
|
||||
|
||||
|
||||
extern void repairMenu_interlockWarning(struct RepairMenu* self, T_INTERLOCK_ID interlockID);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* repairMenu_interlockFailed
|
||||
* Interlock verification failed
|
||||
@@ -161,6 +166,9 @@ extern void repairMenu_interlockFailed(struct RepairMenu* self, T_INTERLOCK_ID i
|
||||
extern void repairMenu_processFailed(struct RepairMenu* self);
|
||||
|
||||
|
||||
extern void repairMenu_printCRCFailure(struct RepairMenu* self, T_ErrorCode errorCode);
|
||||
|
||||
|
||||
extern void repairMenu_menuStateHandle(struct MenuCore* menuCore);
|
||||
|
||||
|
||||
|
||||
@@ -175,6 +175,9 @@ extern bool repairProcess_isProcessRunning(struct RepairProcess* self);
|
||||
extern uint32_t repairProcess_getRemainingRepairTime(const struct RepairProcess* self);
|
||||
|
||||
|
||||
extern uint32_t repairProcess_getTotalRepairtime(const struct RepairProcess* self);
|
||||
|
||||
|
||||
/** ----------------------------------------------------------------------------
|
||||
* repairProcess_getRowInformation
|
||||
* Returns the current active repair time in seconds.
|
||||
|
||||
Reference in New Issue
Block a user