aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-02-27 15:29:38 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-02-27 15:29:38 +0200
commitdcaadc1886a2f5169821ba568a78990cc6ced4bc (patch)
tree1e9e8d906415a2ce8976f454abef8ab02176509e /Software/Embedded_SW/Embedded/Modules
parent067e34ae548d2125cf92477af4e8afb4e85f63ce (diff)
downloadTango-dcaadc1886a2f5169821ba568a78990cc6ced4bc.tar.gz
Tango-dcaadc1886a2f5169821ba568a78990cc6ced4bc.zip
program the alarm definitions and the IDS control to the internal flash. motor info did not work well - probably performance problem in thread PID
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c9
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/process.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c10
3 files changed, 13 insertions, 8 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
index 6f8013557..d107154d0 100644
--- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
@@ -124,8 +124,8 @@ AlarmStatusItem AlarmState[MAX_SYSTEM_ALARMS];
* or static variable whose declaration follows the pragma directive (only if using it without #define for example: #pragma location = MOTOR_MAP_IN_FLASH)
* The variables must be declared either __no_init or const!
*/
-//FLASH_MAP AlarmHandlingItemStruc FlashAlarmItem[MAX_SYSTEM_ALARMS];
-const AlarmHandlingItemStruc AlarmItem[MAX_SYSTEM_ALARMS]={
+AlarmHandlingItemStruc *AlarmItem;
+const AlarmHandlingItemStruc HardCodedAlarmItem[MAX_SYSTEM_ALARMS]={
{eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmEmpty_1,0,false,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,EVENT_TYPE__DISPENSER_1_EMPTY,"Dispenser 1 Empty"},
{eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmEmpty_2,1,false,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,EVENT_TYPE__DISPENSER_2_EMPTY,"Dispenser 2 Empty"},
{eHundredMillisecond,LimitSwitchAlarm,LimitSwitchAlarmEmpty_3,2,false,true,DEBUG_LOG_CATEGORY__Error,0xFF,0,EVENT_TYPE__DISPENSER_3_EMPTY,"Dispenser 3 Empty"},
@@ -329,7 +329,10 @@ void AlarmHandlingInit(void)
AlarmState[Alarm_i].DebounceCounter = 0;
AlarmState[Alarm_i].EventPtr = NULL;
}
-// ReadAppAndProgram(ALARM_MAP_IN_FLASH, sizeof(AlarmHandlingItemStruc)*MAX_SYSTEM_ALARMS, AlarmItem);
+
+ AlarmItem = (AlarmHandlingItemStruc *)MOTOR_MAP_IN_FLASH;
+ ReadAppAndProgram(AlarmItem, sizeof(AlarmHandlingItemStruc)*MAX_SYSTEM_ALARMS, HardCodedAlarmItem);
+ LOG_ERROR(AlarmItem[2].EventName,"Flash Test");
return;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c
index 73402d1f4..dd9f8deae 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/process.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/process.c
@@ -237,7 +237,7 @@ uint32_t ProcessParamsInit(void)
//memcpy (&ProcessParametersKeep,ProcessParams,sizeof(ProcessParameters));
upload_process_parameters_request__free_unpacked(request,NULL);
}
- free (buffer);
+ free (buffer);
}
}
f_close(FileHandle);
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
index e8d0f2673..ed91f194a 100644
--- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c
@@ -17,6 +17,7 @@
#include "modules/heaters/heaters.h"
+#include "drivers/Flash_ram/FlashProgram.h"
typedef struct
{
@@ -29,7 +30,7 @@ typedef struct
bool m_isReady;
PID_Config_Params m_params;
}DispenserControlConfig_t;
-HardwarePidControl DispensersControl[MAX_SYSTEM_DISPENSERS] = {0};
+HardwarePidControl *DispensersControl = (HardwarePidControl *)GENHWCFG_MAP_IN_FLASH + 0x4000;;
int32_t DispenserSamples[MAX_SYSTEM_DISPENSERS][MAX_CONTROL_SAMPLES] = {0};
int DispenserSamplePointer[MAX_SYSTEM_DISPENSERS] = {0};
@@ -66,9 +67,10 @@ uint32_t IDS_DispenserPidRequestMessage(HardwarePidControl* request)
break;
}
}
- memcpy (&DispensersControl[Dispenser_i],request,sizeof(HardwarePidControl));
- if (DispensersControl[Dispenser_i].pvinputfilterfactormode > MAX_CONTROL_SAMPLES)
- DispensersControl[Dispenser_i].pvinputfilterfactormode = MAX_CONTROL_SAMPLES;
+ if (request->pvinputfilterfactormode > MAX_CONTROL_SAMPLES)
+ request->pvinputfilterfactormode = MAX_CONTROL_SAMPLES;
+ ReadAppAndProgram(&DispensersControl[Dispenser_i], sizeof(HardwarePidControl), request);
+
for (i = 0;i < DispensersControl[Dispenser_i].pvinputfilterfactormode; i++)
DispenserSamples[Dispenser_i][i] = 0; //reset the samples value for control beginning
/*DispenserNormalizedErrorCoEfficient[Dispenser_i] = (2*PI*DancersCfg[ThreadDispenserIdToDancerId[Dispenser_i]].armlength);