Updated memory storage functionality

- cachedStorage is functional
- Presets can be loaded from FLASH
- CRC32 added and applied
- Presets with corrputed data will be replaced by default preset

Next: Preset update functionality from menu 

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@269 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-11-02 12:58:27 +00:00
parent 76783a6061
commit 4901cb1a09
27 changed files with 894 additions and 144 deletions

View File

@@ -0,0 +1,69 @@
// -----------------------------------------------------------------------------
/// @file RepairPreset.c
/// @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 RepairPreset.c
/// @ingroup {group_name}
#ifndef REPAIRPRESET_C_
#define REPAIRPRESET_C_
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
#include "RepairPreset.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Type definitions.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Function declarations
// -----------------------------------------------------------------------------
ErrorStatus RepairPreset_generateDefaultPreset(struct RepairPreset* self, unsigned int presetNumber)
{
ErrorStatus returnValue = SUCCESS;
self->presetNumber = presetNumber;
self->numberOfStages = 1;
self->preset[0].softstartDuration = 100;
self->preset[0].duration = 200;
self->preset[0].voltage = 0;
// Generate dummy presets to fill the memory
self->preset[1].softstartDuration = 0;
self->preset[1].duration = 0;
self->preset[1].voltage = 0;
return returnValue;
}
#endif /* REPAIRPRESET_C_ */