]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blobdiff - rpp/blocks/sfunction_gio_in.c
Add comments to GIO blocks
[jenkicar/rpp-simulink.git] / rpp / blocks / sfunction_gio_in.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"