Skip to content

Commit

Permalink
V1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Trusty77 committed Apr 2, 2020
1 parent d83fa91 commit 5f24131
Show file tree
Hide file tree
Showing 64 changed files with 644 additions and 94 deletions.
Binary file modified DCCpp.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion extras/Doc/Comm_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_d41d8cd98f00b204e9800998ecf8427e.html">src</a></li><li class="navelem"><b>Comm.h</b></li>
<li class="footer">Generated on dim. mars 22 2020 14:15:47 for DCCpp &nbsp; by
<li class="footer">Generated on jeu. avr. 2 2020 16:42:25 for DCCpp &nbsp; by
<a href="http://www.copperspice.com/documentation-doxypress.html">
<img class="footer" src="doxypress.png" alt="DoxyPress"/></a> 1.3.6 </li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion extras/Doc/Config_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_d41d8cd98f00b204e9800998ecf8427e.html">src</a></li><li class="navelem"><b>Config.h</b></li>
<li class="footer">Generated on dim. mars 22 2020 14:15:47 for DCCpp &nbsp; by
<li class="footer">Generated on jeu. avr. 2 2020 16:42:25 for DCCpp &nbsp; by
<a href="http://www.copperspice.com/documentation-doxypress.html">
<img class="footer" src="doxypress.png" alt="DoxyPress"/></a> 1.3.6 </li>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions extras/Doc/CurrentMonitor_8cpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/**********************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">CurrentMonitor.cpp</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">COPYRIGHT (c) 2013-2016 Gregg E. Berman</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">Part of DCC++ BASE STATION for the Arduino</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">**********************************************************************/</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="preprocessor">#include &quot;Arduino.h&quot;</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="preprocessor">#include &quot;DCCpp_Uno.h&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="preprocessor">#include &quot;CurrentMonitor.h&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#include &quot;Comm.h&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="structCurrentMonitor.html#aec4b8f83dd8d5715a9ae21411633c697"> 18</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="structCurrentMonitor.html#aec4b8f83dd8d5715a9ae21411633c697">CurrentMonitor::begin</a>(<span class="keywordtype">int</span> pin, <span class="keywordtype">int</span> inSignalPin, <span class="keyword">const</span> <span class="keywordtype">char</span> *msg, <span class="keywordtype">float</span> inSampleMax)</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;{</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; this-&gt;pin = <a class="code" href="structCurrentMonitor.html#a75c7b76d3cbc8207f6f77ef2b6e35301">pin</a>;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; this-&gt;<a class="code" href="structCurrentMonitor.html#aeb5272629eb9b4e810b8f7f21651a6f4">signalPin</a> = inSignalPin;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; this-&gt;msg = <a class="code" href="structCurrentMonitor.html#a0d39b1f9324033a87094feebd2b1b501">msg</a>;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; this-&gt;<a class="code" href="structCurrentMonitor.html#a5d7913a8c985e532b36962d2088cb676">current</a> = 0;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; this-&gt;<a class="code" href="structCurrentMonitor.html#a12b999d776526131f8d008d3396589ff">currentSampleMax</a> = inSampleMax;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;} <span class="comment">// CurrentMonitor::begin</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; </div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="structCurrentMonitor.html#a3f65185db0c2179eb925c829ba22c2d6"> 27</a></span>&#160;<span class="keywordtype">boolean</span> <a class="code" href="structCurrentMonitor.html#a3f65185db0c2179eb925c829ba22c2d6">CurrentMonitor::checkTime</a>()</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;{</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keywordflow">if</span>(millis( ) - <a class="code" href="structCurrentMonitor.html#ad82c5feea9c57d5b8d034d7a69301a81">sampleTime</a> &lt; CURRENT_SAMPLE_TIME) <span class="comment">// no need to check current yet</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="keywordflow">return</span>(<span class="keyword">false</span>);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <a class="code" href="structCurrentMonitor.html#ad82c5feea9c57d5b8d034d7a69301a81">sampleTime</a> = millis(); <span class="comment">// note millis() uses TIMER-0. For UNO, we change the scale on Timer-0. For MEGA we do not. This means CURENT_SAMPLE_TIME is different for UNO then MEGA</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keywordflow">return</span>(<span class="keyword">true</span>); </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;} <span class="comment">// CurrentMonitor::checkTime</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="structCurrentMonitor.html#a485def380e9c87c17dc2f1c8720e005a"> 35</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="structCurrentMonitor.html#a485def380e9c87c17dc2f1c8720e005a">CurrentMonitor::check</a>()</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;{</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keywordflow">if</span> (this-&gt;<a class="code" href="structCurrentMonitor.html#a75c7b76d3cbc8207f6f77ef2b6e35301">pin</a> == UNDEFINED_PIN || this-&gt;<a class="code" href="structCurrentMonitor.html#aeb5272629eb9b4e810b8f7f21651a6f4">signalPin</a> == UNDEFINED_PIN)</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordflow">return</span>;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; this-&gt;<a class="code" href="structCurrentMonitor.html#a5d7913a8c985e532b36962d2088cb676">current</a> = (float)(analogRead(this-&gt;<a class="code" href="structCurrentMonitor.html#a75c7b76d3cbc8207f6f77ef2b6e35301">pin</a>) * CURRENT_SAMPLE_SMOOTHING + this-&gt;<a class="code" href="structCurrentMonitor.html#a5d7913a8c985e532b36962d2088cb676">current</a> * (1.0 - CURRENT_SAMPLE_SMOOTHING)); <span class="comment">// compute new exponentially-smoothed current</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="comment">// current overload and Signal is on</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordflow">if</span> (this-&gt;<a class="code" href="structCurrentMonitor.html#a5d7913a8c985e532b36962d2088cb676">current</a> &gt; this-&gt;<a class="code" href="structCurrentMonitor.html#a12b999d776526131f8d008d3396589ff">currentSampleMax</a> &amp;&amp; digitalRead(this-&gt;<a class="code" href="structCurrentMonitor.html#aeb5272629eb9b4e810b8f7f21651a6f4">signalPin</a>) == HIGH)</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; digitalWrite(this-&gt;<a class="code" href="structCurrentMonitor.html#aeb5272629eb9b4e810b8f7f21651a6f4">signalPin</a>, LOW);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; DCCPP_INTERFACE.print(this-&gt;<a class="code" href="structCurrentMonitor.html#a0d39b1f9324033a87094feebd2b1b501">msg</a>); <span class="comment">// print corresponding error message</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor">#if !defined(USE_ETHERNET)</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; DCCPP_INTERFACE.println(<span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; }</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;} <span class="comment">// CurrentMonitor::check </span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="keywordtype">long</span> <span class="keywordtype">int</span> <a class="code" href="structCurrentMonitor.html#ad82c5feea9c57d5b8d034d7a69301a81">CurrentMonitor::sampleTime</a>=0;</div><div class="ttc" id="astructCurrentMonitor_html_a485def380e9c87c17dc2f1c8720e005a"><div class="ttname"><a href="structCurrentMonitor.html#a485def380e9c87c17dc2f1c8720e005a">CurrentMonitor::check</a></div><div class="ttdeci">void check()</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8cpp_source.html#l00035">CurrentMonitor.cpp:35</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_a3f65185db0c2179eb925c829ba22c2d6"><div class="ttname"><a href="structCurrentMonitor.html#a3f65185db0c2179eb925c829ba22c2d6">CurrentMonitor::checkTime</a></div><div class="ttdeci">static boolean checkTime()</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8cpp_source.html#l00027">CurrentMonitor.cpp:27</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_a75c7b76d3cbc8207f6f77ef2b6e35301"><div class="ttname"><a href="structCurrentMonitor.html#a75c7b76d3cbc8207f6f77ef2b6e35301">CurrentMonitor::pin</a></div><div class="ttdeci">int pin</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8h_source.html#l00029">CurrentMonitor.h:29</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_aec4b8f83dd8d5715a9ae21411633c697"><div class="ttname"><a href="structCurrentMonitor.html#aec4b8f83dd8d5715a9ae21411633c697">CurrentMonitor::begin</a></div><div class="ttdeci">void begin(int pin, int inSignalPin, const char *msg, float inSampleMax=300)</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8cpp_source.html#l00018">CurrentMonitor.cpp:18</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_ad82c5feea9c57d5b8d034d7a69301a81"><div class="ttname"><a href="structCurrentMonitor.html#ad82c5feea9c57d5b8d034d7a69301a81">CurrentMonitor::sampleTime</a></div><div class="ttdeci">static long int sampleTime</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8h_source.html#l00028">CurrentMonitor.h:28</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_aec4b8f83dd8d5715a9ae21411633c697"><div class="ttname"><a href="structCurrentMonitor.html#aec4b8f83dd8d5715a9ae21411633c697">CurrentMonitor::begin</a></div><div class="ttdeci">void begin(int pin, int inSignalPin, const char *msg, float inSampleMax=300)</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8cpp_source.html#l00018">CurrentMonitor.cpp:18</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_aeb5272629eb9b4e810b8f7f21651a6f4"><div class="ttname"><a href="structCurrentMonitor.html#aeb5272629eb9b4e810b8f7f21651a6f4">CurrentMonitor::signalPin</a></div><div class="ttdeci">int signalPin</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8h_source.html#l00030">CurrentMonitor.h:30</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_a0d39b1f9324033a87094feebd2b1b501"><div class="ttname"><a href="structCurrentMonitor.html#a0d39b1f9324033a87094feebd2b1b501">CurrentMonitor::msg</a></div><div class="ttdeci">const char * msg</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8h_source.html#l00033">CurrentMonitor.h:33</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_a5d7913a8c985e532b36962d2088cb676"><div class="ttname"><a href="structCurrentMonitor.html#a5d7913a8c985e532b36962d2088cb676">CurrentMonitor::current</a></div><div class="ttdeci">float current</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8h_source.html#l00032">CurrentMonitor.h:32</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_a12b999d776526131f8d008d3396589ff"><div class="ttname"><a href="structCurrentMonitor.html#a12b999d776526131f8d008d3396589ff">CurrentMonitor::currentSampleMax</a></div><div class="ttdeci">float currentSampleMax</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8h_source.html#l00031">CurrentMonitor.h:31</a></div></div>
<div class="ttc" id="astructCurrentMonitor_html_a5d7913a8c985e532b36962d2088cb676"><div class="ttname"><a href="structCurrentMonitor.html#a5d7913a8c985e532b36962d2088cb676">CurrentMonitor::current</a></div><div class="ttdeci">float current</div><div class="ttdef"><b>Definition:</b> <a href="CurrentMonitor_8h_source.html#l00032">CurrentMonitor.h:32</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- Generated by DoxyPress 1.3.6 -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_d41d8cd98f00b204e9800998ecf8427e.html">src</a></li><li class="navelem"><b>CurrentMonitor.cpp</b></li>
<li class="footer">Generated on dim. mars 22 2020 14:15:47 for DCCpp &nbsp; by
<li class="footer">Generated on jeu. avr. 2 2020 16:42:25 for DCCpp &nbsp; by
<a href="http://www.copperspice.com/documentation-doxypress.html">
<img class="footer" src="doxypress.png" alt="DoxyPress"/></a> 1.3.6 </li>
</ul>
Expand Down
Loading

0 comments on commit 5f24131

Please sign in to comment.