]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Add comments to GIO blocks
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 5 Oct 2015 08:35:02 +0000 (10:35 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 5 Oct 2015 08:35:02 +0000 (10:35 +0200)
rpp/blocks/sfunction_gio_in.c
rpp/blocks/sfunction_gio_out.c

index 00238c68af677728cb22bd07426b049e1c2a250c..4bf674d2ef81e88abcbc5961d175b65538fdd033 100644 (file)
@@ -59,6 +59,29 @@ Relevant demos:
 ...
 */
 
+/*
+ * Block mask documentation
+ * ------------------------
+ *
+ * This S-function has only the PIN_NAME parameter, but the block mask
+ * has two parameters for pin selection: PIN and PIN_NAME. PIN
+ * parameter is shown as a popup list with pin names available on the
+ * given board. When a pin is selected from this list, the callback
+ * function copies the value from PIN to PIN_NAME parameter. By
+ * default, PIN_NAME is not shown in the dialog.
+ *
+ * It might happen that a model designed for one board is opened for
+ * another board (i.e. rpp_setup was called when the RPP C library was
+ * compiled for another board). If we had only the PIN popup and the
+ * other board had different pin names, than the value of the PIN
+ * parameter would be lost (Simulink would set the parameter to the
+ * default value). With our two parameters, PIN_NAME is not changed
+ * (it's an edit box) and PIN is set to the default value '---', which
+ * results in PIN_NAME to be shown to the user. This way, the user
+ * sees the original pin name and can select the appropriate pin on
+ * the new board from the PIN list.
+ */
+
 
 #define S_FUNCTION_NAME sfunction_gio_in
 #include "header.c"
index 07fab314f3c7dcb1f5586fcf5eef9121dab5eded..236f9eb7e46ce5da996dbe40cb724e1ac9cfcd18 100644 (file)
@@ -64,6 +64,9 @@ Relevant demos:
 ...
 */
 
+/*
+ * Block mask documentation - see sfunction_gio_in.c
+ */
 
 #define S_FUNCTION_NAME sfunction_gio_out
 #include "header.c"