]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
Generate list of GIO pin names
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 3 Oct 2015 10:42:54 +0000 (12:42 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 3 Oct 2015 10:44:14 +0000 (12:44 +0200)
This list will be used by Simulink GIO blocks to offer the user a list
of valid pin names for the active target.

build/.gitignore
build/Makefile.lib.inc
build/Makefile.rules.arm
build/Makefile.rules.posix
rpp/src/.gitattributes [new file with mode: 0644]
rpp/src/gio_names.txt.tmpl [new file with mode: 0644]

index 7b0cf270e336953126c54698c65611b627d1e12a..e9186a00f30982b4ffd8fb06362e1d8c9c023e66 100644 (file)
@@ -2,6 +2,7 @@ rpp-lib.lib
 rpp-lib.a
 os/
 rpp/
+/gio_names.txt
 .settings/
 lwip/
 ccsObjs.opt
index 60f5d2b0eb4be3213e2560922c095d25574402a1..c35a511ac2a3c09125ae0e3e99420c852b3e863b 100644 (file)
@@ -45,9 +45,10 @@ rpp_lib_DEPS = $(rpp_lib_OBJS:%=%.dep)
 rpp-lib.lib: $(rpp_lib_OBJS) #../rpp/TMS570LS313xFlashLnk.cmd
        $(AR) r $@ $^
 
-$(makefile_lib_inc_dir)/../rpp-lib.lib: rpp-lib.lib
+$(makefile_lib_inc_dir)/../rpp-lib.lib: rpp-lib.lib rpp/src/gio_names.txt
        $(call cp,$<,$@)
        $(call cp,$(call pathconv,../Makefile.config),$(dir $@))
+       $(call cp,$(call pathconv,rpp/src/gio_names.txt),$(makefile_lib_inc_dir))
 
 -include $(rpp_lib_DEPS)
 
@@ -59,6 +60,11 @@ $(rpp_lib_asm_OBJS): %.obj: $(makefile_lib_inc_dir)/../%.asm
        $(call mkdir,$(dir $@))
        $(RPP_COMPILE_CMD)
 
+rpp/src/gio_names.txt: %: $(makefile_lib_inc_dir)/../%.tmpl
+       $(call mkdir,$(dir $@))
+       $(RPP_PREPROC_CMD)
+
+
 .PHONY: all clean $(makefile_lib_inc_dir)/../rpp-lib.lib
 
 clean::
index 1a9cc2f70a588862fc1a04c31da6050888fc5cd3..b730edab79fc93c5b9b89711b425d0ff135b3cf2 100644 (file)
@@ -59,6 +59,7 @@ RPP_MAKE_CFLAGS = \
                --preproc_with_compile
 
 RPP_COMPILE_CMD = $(CC) $(RPP_CFLAGS) $(RPP_MAKE_CFLAGS) $<
+RPP_PREPROC_CMD = $(CC) $(RPP_CFLAGS) --preproc_only --output_file=$@ $<
 
 BUILD_DIR ?= Debug
 RPP_LIB_DIR = $(makefile_rules_arm_dir)/$(TARGET)/$(BUILD_DIR)
index ea9cbe3d565decfa6041bb79544e2a3560f38c1d..7434ce57d155611cefa5819a939e9b271a07566f 100644 (file)
@@ -35,6 +35,7 @@ RPP_MAKE_CFLAGS = \
                -MD -MF $@.dep -MP -MT $@
 
 RPP_COMPILE_CMD = $(CC) -c $(RPP_CFLAGS) $(RPP_MAKE_CFLAGS) -o $@ $<
+RPP_PREPROC_CMD = $(CC) -E $(RPP_CFLAGS) -P -x c -o $@ $<
 
 BUILD_DIR ?= Debug
 RPP_LIB_DIR = $(makefile_rules_posix_dir)/$(TARGET)/$(BUILD_DIR)
diff --git a/rpp/src/.gitattributes b/rpp/src/.gitattributes
new file mode 100644 (file)
index 0000000..66858d1
--- /dev/null
@@ -0,0 +1 @@
+/gio_names.txt.tmpl    eaton
diff --git a/rpp/src/gio_names.txt.tmpl b/rpp/src/gio_names.txt.tmpl
new file mode 100644 (file)
index 0000000..72badf8
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+ * Template for generating list of GIO pin names for use by GIO
+ * Simulink blocks
+ */
+#define GIO_PIN_DEF_GEN(name, port, pin, conf) name
+#include "drv/gio_def.h"