lpcmanager

a1db1a229b77
Parents f299e9b6a5e3
Children 9ef7fb16f951
More support for MM1 : Linux RT patch and no CANopen
--- a/LPCBus/SOM_Devices_decl.c Tue Nov 08 11:06:14 2022 +0100
+++ b/LPCBus/SOM_Devices_decl.c Tue Feb 14 12:06:23 2023 +0100
@@ -5,9 +5,7 @@
#include <fcntl.h>
#include <sys/select.h>
-#include <alchemy/task.h>
-#include <alchemy/mutex.h>
-#include <alchemy/timer.h>
+#include <pthread.h>
#include "beremiz.h"
@@ -141,7 +139,9 @@
static uint64_t lastCommTime=0;
struct sched_param param = { .sched_priority = 10 };
+#ifdef _GNU_SOURCE
pthread_setname_np(pthread_self(), "UART_task");
+#endif
pthread_setschedparam(pthread_self(), SCHED_FIFO, &param);
while (1){
--- a/LPCBus/SOM_OnBoard_decl.c Tue Nov 08 11:06:14 2022 +0100
+++ b/LPCBus/SOM_OnBoard_decl.c Tue Feb 14 12:06:23 2023 +0100
@@ -1,6 +1,5 @@
#include <unistd.h>
#include <fcntl.h>
-#include <rtdm/rtdm.h>
#include "beremiz.h"
/*------------------------- GPIO -------------------------------------*/
--- a/LPCExtension.py Tue Nov 08 11:06:14 2022 +0100
+++ b/LPCExtension.py Tue Feb 14 12:06:23 2023 +0100
@@ -8,7 +8,7 @@
import features
from POULibrary import SimplePOULibraryFactory
-from LPCArch import GetLPCProduct, GetLPCSOM, MC9_modules, WX_GOT_modules, SVG_GOT_modules, GetLPCArch
+from LPCArch import GetLPCProduct, GetLPCSOM, WX_GOT_modules, SOM28_modules, SOM6_modules, SVG_GOT_modules, GetLPCArch
# _lpcmanager_path, arch, etc are defined here because
# globals() of LPCManager.py are passed to extentions
@@ -20,12 +20,12 @@
return os.path.join(_lpcmanager_path, 'Pous', "pous"+name+".xml")
product = GetLPCProduct()
-if product in MC9_modules + WX_GOT_modules + SVG_GOT_modules:
+if product in SOM28_modules + SOM6_modules:
features.libraries += [('Python', 'py_ext.PythonLibrary', True),
('RTC', SimplePOULibraryFactory(_poulibpath("RTC")), True)]
if product in WX_GOT_modules + SVG_GOT_modules:
features.libraries += [('GOT', SimplePOULibraryFactory(_poulibpath("GOT")), True)]
- if product in SVG_GOT_modules:
+ if product in SOM6_modules:
features.libraries += [('SVGHMI', 'LPCSVGHMI.SVGHMILibrary', True)]
else: # MC8 ?
features.libraries += [('LPC', SimplePOULibraryFactory(_poulibpath("LPC")), True)]
@@ -48,7 +48,7 @@
('LPCBus', _('LPC bus'), _('Support for Smarteh modules'), 'LPCBus.LPCBus'),
('CanOpen', _('CANOpen'), _('Support for CANopen'), 'LPCCanFestival.LPCCanOpen')]
-if product in SVG_GOT_modules:
+if product in SOM6_modules:
features.catalog += [ catalog_index['svghmi'][:3]+('LPCSVGHMI.SVGHMI',) ]
#
# --------- Connectors Extension ------------
@@ -77,10 +77,17 @@
som = GetLPCSOM()
if som is not None:
+ # added for MM1 dev, TODO merge with SOM6
+ if product == "MM1":
+ rtosname = "Linux"
+ XSDname = "XSD_MM1"
+ else:
+ rtosname = "Xenomai"
+ XSDname = "XSD"
targets.targets = {product : {
- "xsd": os.path.join(_lpcmanager_path, som+"target", "XSD"),
- "class": targets.targets["Xenomai"]["class"],
- "code": {"plc_"+som+"_main.c": targets.targets["Xenomai"]["code"]["plc_Xenomai_main.c"],
+ "xsd": os.path.join(_lpcmanager_path, som+"target", XSDname),
+ "class": targets.targets[rtosname]["class"],
+ "code": {"plc_"+som+"_main.c": targets.targets[rtosname]["code"]["plc_"+rtosname+"_main.c"],
"plc_"+som+"_main_retain.c": os.path.join(_lpcmanager_path,
som+"target",
"plc_"+som+"_main_retain.c")}}}
--- a/LPCProjectController.py Tue Nov 08 11:06:14 2022 +0100
+++ b/LPCProjectController.py Tue Feb 14 12:06:23 2023 +0100
@@ -155,11 +155,12 @@
else :
ProjectController.LoadProject(self, ProjectPath, BuildPath)
- canopen_child = self.GetChildByName("CanOpen")
- if canopen_child is None:
- canopen = self.CTNAddChild("CanOpen", "CanOpen", 0)
- canopen.LoadChildren()
- canopen.CTNRequestSave()
+ if GetLPCProduct() != "MM1":
+ canopen_child = self.GetChildByName("CanOpen")
+ if canopen_child is None:
+ canopen = self.CTNAddChild("CanOpen", "CanOpen", 0)
+ canopen.LoadChildren()
+ canopen.CTNRequestSave()
self.SetParamsAttribute('BeremizRoot.TargetType', self.arch)
--- a/SOM6Target/plc_SOM6_main_retain.c Tue Nov 08 11:06:14 2022 +0100
+++ b/SOM6Target/plc_SOM6_main_retain.c Tue Feb 14 12:06:23 2023 +0100
@@ -1,3 +1,7 @@
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/fcntl.h>
#define NVRAM_SIZE 0x10000
#define IDLEN 4