From: Michal Sojka Date: Mon, 5 Oct 2015 08:35:02 +0000 (+0200) Subject: Add comments to GIO blocks X-Git-Tag: eaton-0.7~1 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-simulink.git/commitdiff_plain/8157d2977a5f0ef72e3ed1f06c50af636d4ef49c Add comments to GIO blocks --- diff --git a/rpp/blocks/sfunction_gio_in.c b/rpp/blocks/sfunction_gio_in.c index 00238c6..4bf674d 100644 --- a/rpp/blocks/sfunction_gio_in.c +++ b/rpp/blocks/sfunction_gio_in.c @@ -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" diff --git a/rpp/blocks/sfunction_gio_out.c b/rpp/blocks/sfunction_gio_out.c index 07fab31..236f9eb 100644 --- a/rpp/blocks/sfunction_gio_out.c +++ b/rpp/blocks/sfunction_gio_out.c @@ -64,6 +64,9 @@ Relevant demos: ... */ +/* + * Block mask documentation - see sfunction_gio_in.c + */ #define S_FUNCTION_NAME sfunction_gio_out #include "header.c"