implemented memory device, flashStorage and cached storage

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@268 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-31 07:35:17 +00:00
parent a50a10995f
commit 76783a6061
17 changed files with 1103 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-24990244560702828" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="510461499985258339" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@@ -18,7 +18,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-24990244560702828" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="510461499985258339" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

View File

@@ -62,7 +62,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 256K
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 254K
}
/* Sections */

View File

@@ -25,6 +25,8 @@
// Include files
// -----------------------------------------------------------------------------
#include <stdlib.h>
#include "DAConverter.h"
#include "Logger.h"
@@ -91,7 +93,7 @@ extern ErrorStatus DAConverter_setOutputVoltage(const struct DAConverter* self,
uint32_t dacValue;
dacValue = calculateDACValue(self, voltage);
DACDevice_write(self->dacDevice, dacValue);
LOGGER_DEBUG(mainLog, "Voltage %d --- value %X", voltage, dacValue);
LOGGER_DEBUG(mainLog, "Voltage %d --- value %X", voltage, (unsigned int)dacValue);
}
}
else

View File

@@ -25,6 +25,7 @@
// Include files
// -----------------------------------------------------------------------------
#include <stdlib.h>
#include <string.h>
#include "hsb-mrts.h"

View File

@@ -47,6 +47,7 @@
#include "misc.h"
#include "stm32f10x_rcc.h"
#include "CachedStorage.h"
#include "DisplayDevice.h"
#include "KeyboardDevice.h"
#include "MAX5715.h"
@@ -56,10 +57,12 @@
#include "CathodeMCP.h"
#include "Interlock.h"
#include "internalADC.h"
#include "InternalFlash.h"
#include "gpio.h"
#include "IODevice.h"
#include "keypadMatrix.h"
#include "Logger.h"
#include "MemoryDevice.h"
#include "PCBA.h"
#include "uart.h"
#include "spi.h"
@@ -102,6 +105,7 @@ static struct HwValidationMenuItems hwTestItems;
struct HwValidationMenu* hwValidation = &_hwValidation;
static struct CachedStorage cs = {.initialized = false};
// -----------------------------------------------------------------------------
// Function declarations
@@ -125,7 +129,7 @@ int main (void)
ledTaskArguments.led = ledOrange;
ledTaskArguments.frequency = 1;
xTaskCreate(initTask, (const char* const)"initTask", 1024, NULL, 5, &initTaskHandle);
xTaskCreate(initTask, (const char* const)"initTask", 2048, NULL, 5, &initTaskHandle);
/* Start the scheduler. */
vTaskStartScheduler();
@@ -199,17 +203,17 @@ static void initTask(void* parameters)
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 100, &ledTaskArguments, 0, &ledTaskHandle);
// Construct the displays
Displays_construct();
// Displays_construct();
// Construct the AD Converters
ADConverters_construct();
// ADConverters_construct();
// Construct the DA Converters
DAConverters_construct();
// DAConverters_construct();
hsb_generateStartScreen(mainDisplay);
// hsb_generateStartScreen(mainDisplay);
// Let start screen stay for 5 seconds
vTaskDelay(INIT_START_SCREEN_DELAY);
// vTaskDelay(INIT_START_SCREEN_DELAY);
///TODO MUST BE UPDATED
@@ -232,7 +236,35 @@ static void initTask(void* parameters)
// HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 1, 1024);
// Construct the repair menu
repairMenus_construct();
// repairMenus_construct();
uint32_t buffer[128];
int i;
for (i = 0; i < 128; i++)
{
buffer[i] = i + 4;
vTaskDelay(20);
}
//
// vTaskDelay(5000);
//
CachedStorage_construct(&cs, &iFlash->memoryDevice, 127, CACHED_STORAGE_PAGESIZE);
MemoryDevice_erasePage(&iFlash->memoryDevice, 127);
CachedStorage_writeBlob(&cs, 0, buffer, sizeof(buffer));
CachedStorage_commit(&cs);
////
// vTaskDelay(1000);
//
const uint32_t* buffer2;
buffer2 = CachedStorage_readBlob(&cs, 0);
for (i = 0; i < 128; i++)
{
LOGGER_DEBUG(mainLog, "Value %d ---> %d", i, (unsigned int)buffer2[i]);
vTaskDelay(20);
}
// Create task that repeats to print out TASK information on the logger
xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 0, &sysTaskHandle);

View File

@@ -922,6 +922,7 @@ static ErrorStatus repairMenu_createMenu(struct RepairMenu* self)
repairMenu_addKeyAction_SCROLLUP(&self->menuArray[RM_PRESET_PRINT], 'U', PRESSED);
repairMenu_addKeyAction_SCROLLDOWN(&self->menuArray[RM_PRESET_PRINT], 'D', PRESSED);
repairMenu_addKeyAction_GOTOSTATE(&self->menuArray[RM_PRESET_PRINT], 'X', PRESSED, PRESETMENU);
repairMenu_addKeyAction_GOTOSTATE(&self->menuArray[PRESETMENU], 'L', PRESSED, PRESETMENU);
repairMenu_createMenuPage(&self->menuArray[REPAIR_RUNNING], MENU_HAS_NO_CURSOR, 4);
repairMenu_addKeyAction_GOTOSTATE(&self->menuArray[REPAIR_RUNNING], 'X', PRESSED, REPAIR_ASK_PAUSE);

View File

@@ -229,7 +229,7 @@ static void repairProcess_task(void* parameters)
// The signal profile is identical for all rows in the regulation process
SignalProfileGenerator_calculate(&self->signalProfileGenerator);
LOGGER_DEBUG(mainLog, "Signal: %d, TimeToRemain %d", self->signalProfileGenerator.signal, SignalProfileGenerator_getRemainingTime(&self->signalProfileGenerator));
LOGGER_DEBUG(mainLog, "Signal: %d, TimeToRemain %d", self->signalProfileGenerator.signal, (unsigned int)SignalProfileGenerator_getRemainingTime(&self->signalProfileGenerator));
// Check for correct signal
// if (self->signalProfileGenerator.signal >= 0)