]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Update AIN and AOUT blocks to use the renamed functions
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 13 Aug 2013 20:58:23 +0000 (22:58 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 13 Aug 2013 20:58:23 +0000 (22:58 +0200)
rpp_ain_* functions were renamed to rpp_adc_* and rpp_aout_* to rpp_dac_*.

Now all demos seem to compile. They were not (yet) tested for
functionality.

rpp/blocks/tlc_c/sfunction_ain.tlc
rpp/blocks/tlc_c/sfunction_aout.tlc
rpp/lib

index 5d6fb093cc81b75c042ecf2bc40eb7593d96107b..b06e45bf64e40b768322000e59f53b01c930dcbb 100644 (file)
     %if !SLibCodeGenForSim()
 
         %% Declare temporal variables
-        %if EXISTS("_RPP_AIN_TMP_VARS_") == 0
-            %assign ::_RPP_AIN_TMP_VARS_ = 1
-            int16_t ain_tmp;
+        %if EXISTS("_RPP_ADC_TMP_VARS_") == 0
+            %assign ::_RPP_ADC_TMP_VARS_ = 1
+            int16_t adc_tmp;
         %endif
 
         %% Error flag
         %assign err_flag = LibBlockOutputSignal(1, "", "", 0)
 
         %% First executed block must update cached values
-        %if EXISTS("_RPP_AIN_UPDATE_") == 0
-            %assign _RPP_AIN_UPDATE_ = 1
-            if(rpp_ain_update() != SUCCESS) {
+        %if EXISTS("_RPP_ADC_UPDATE_") == 0
+            %assign _RPP_ADC_UPDATE_ = 1
+            if(rpp_adc_update() != SUCCESS) {
                 %<err_flag> = TRUE;
             }
         %endif
         %assign pin_num = LibBlockParameterValue(p1, 0)
 
         %% Get pin value
-        ain_tmp = rpp_ain_get(%<pin_num>);
+        adc_tmp = rpp_adc_get(%<pin_num>);
         /* <0 for error code, and =0 for broken ADC */
-        if(ain_tmp <= 0) {
+        if(adc_tmp <= 0) {
             %<err_flag> = TRUE;
-            ain_tmp = 0;
+            adc_tmp = 0;
         }
 
         %% Return input
         %assign analog_in = LibBlockOutputSignal(0, "", "", 0)
-        %<analog_in> = ain_tmp;
+        %<analog_in> = adc_tmp;
 
     %endif
 
index 7f454596050454887a47a3893e1d66b5b2ce71e8..11d40865e6e7ba5e43414755c364983436ddb1cb 100644 (file)
 
     %if !SLibCodeGenForSim()
         %assign pin_num = LibBlockParameterValue(p1, 0)
-        rpp_aout_setup(%<pin_num>, TRUE);
-        rpp_aout_set(%<pin_num>, 0);
+        rpp_dac_setup(%<pin_num>, TRUE);
+        rpp_dac_set(%<pin_num>, 0);
         /*
-         * Warning! This should be the correct way to initialize AOUT.
-         * Nevertheless rpp_aout_update() has a known bug that if it is called
+         * Warning! This should be the correct way to initialize DAC.
+         * Nevertheless rpp_dac_update() has a known bug that if it is called
          * before starting the FreeRTOS Scheduler the application will freeze.
          * Check the RPP API documentation for more information.
          * Not updating now is harmless though.
          */
-        /* rpp_aout_update(); */
+        /* rpp_dac_update(); */
     %endif
 
 %endfunction
@@ -74,9 +74,9 @@
         %assign err_flag = LibBlockOutputSignal(0, "", "", 0)
 
         %if use_voltage
-        if(rpp_aout_set_voltage(%<pin_num>, %<analog_out>) != SUCCESS) {
+        if(rpp_dac_set_voltage(%<pin_num>, %<analog_out>) != SUCCESS) {
         %else
-        if(rpp_aout_set(%<pin_num>, %<analog_out>) != SUCCESS) {
+        if(rpp_dac_set(%<pin_num>, %<analog_out>) != SUCCESS) {
         %endif
 
             %<err_flag> = TRUE;
@@ -84,7 +84,7 @@
         } else {
             %% The call is smart enought to commit only the changed outputs
             %% so it is efficient to call this at the end of each block.
-            if(rpp_aout_update() != SUCCESS) {
+            if(rpp_dac_update() != SUCCESS) {
                 %<err_flag> = TRUE;
             }
         }
diff --git a/rpp/lib b/rpp/lib
index 7620bd277ac6367b09581d47ca08bdf80743430f..c334a47e51d36ee1b17f836220e11b55e38e16ff 160000 (submodule)
--- a/rpp/lib
+++ b/rpp/lib
@@ -1 +1 @@
-Subproject commit 7620bd277ac6367b09581d47ca08bdf80743430f
+Subproject commit c334a47e51d36ee1b17f836220e11b55e38e16ff