\hypertarget{bsp___calculus_8cpp_source}{}\doxysection{bsp\+\_\+\+Calculus.\+cpp}
\label{bsp___calculus_8cpp_source}\index{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_math/bsp\_Calculus.cpp@{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_math/bsp\_Calculus.cpp}}
\mbox{\hyperlink{bsp___calculus_8cpp}{浏览该文件的文档.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00001}00001 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00002}00002 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00003}00003 \textcolor{comment}{ \#  Copyright (c) 2022 Yuankang Liang(XerolySkinner)}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00004}00004 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00005}00005 \textcolor{comment}{ \#  本软件按原样提供,无任何明示或暗示}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00006}00006 \textcolor{comment}{ \#  在任何情况下,作者都不承担任何损害赔偿责任}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00007}00007 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00008}00008 \textcolor{comment}{ \#  使用的许可声明:}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00009}00009 \textcolor{comment}{ \#  1.  不得歪曲本软件的来源,你不能声称你编写了原始软件.}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00010}00010 \textcolor{comment}{ \#  2.  免费授予以任何目的,前提是版权声明出现在所有副本中.}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00011}00011 \textcolor{comment}{ \#      并且版权声明和许可声明同时出现.}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00012}00012 \textcolor{comment}{ \#  3.  你有使用,复制,修改,分发,和销售本软件的许可.}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00013}00013 \textcolor{comment}{ \#  4.  如果你在产品中使用,产品文档中的声明是赞赏的但不是必须的.}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00014}00014 \textcolor{comment}{ \#  5.  本通知不得从任何来源删除或更改.}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00015}00015 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00016}00016 \textcolor{comment}{ \#  Yuankang Liang(XerolySkinner)}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00017}00017 \textcolor{comment}{ \#      E-\/mail:zabbcccbbaz@163.com}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00018}00018 \textcolor{comment}{ \#      QQ:2715099320}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00019}00019 \textcolor{comment}{ \#      Mobile Phone:13005636215}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00020}00020 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00021}00021 \textcolor{comment}{ \#  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00022}00022 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00023}00023 }
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00035}00035 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00036}00036 \textcolor{comment}{//  头文件}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{bsp___calculus_8h}{bsp\_Calculus.h}}"{}}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00039}00039 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00040}00040 \textcolor{comment}{//  类函数}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00046}\mbox{\hyperlink{classbsp___differential_a46536b15be29d856b09dd7d261a12ab1}{00046}} \textcolor{comment}{}\textcolor{keywordtype}{float} \mbox{\hyperlink{classbsp___differential_a46536b15be29d856b09dd7d261a12ab1}{bsp\_Differential::Differential}}(\textcolor{keywordtype}{float} var) \{}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00047}00047     \textcolor{keyword}{static} \textcolor{keywordtype}{float} old=var;}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00048}00048     \textcolor{keywordtype}{float} result= (var -\/ old) / \mbox{\hyperlink{classbsp___differential_ab25588868059974b8356e975c6e96992}{dt}};}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00049}00049     old = var;}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00050}00050     \textcolor{keywordflow}{return} result;\}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00052}00052 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00053}00053 \textcolor{comment}{//  类函数}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00059}\mbox{\hyperlink{classbsp___integral_ade46f89bfdc6dd778c045a51c76c1839}{00059}} \textcolor{comment}{}\textcolor{keywordtype}{float} \mbox{\hyperlink{classbsp___integral_ade46f89bfdc6dd778c045a51c76c1839}{bsp\_Integral::Integral}}(\textcolor{keywordtype}{float} var) \{}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00060}00060     \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{results}} += var * \mbox{\hyperlink{classbsp___integral_a4494cf9fc2873d457ed3bf8618b68045}{dt}};}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00061}00061     \textcolor{keywordflow}{return} \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{results}};\}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00062}00062 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00067}\mbox{\hyperlink{classbsp___integral_aaf7474301ed76ca9ce2b1884ae870019}{00067}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___integral_aaf7474301ed76ca9ce2b1884ae870019}{bsp\_Integral::Integral\_set}}(\textcolor{keywordtype}{float} results) \{}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00068}00068     \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{bsp\_Integral::results}} = \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{results}};\}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00069}00069 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00075}\mbox{\hyperlink{classbsp___integral_a86d9e02d1146744fe80ebab69070abb4}{00075}} \textcolor{comment}{}\mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}} \mbox{\hyperlink{classbsp___integral_a86d9e02d1146744fe80ebab69070abb4}{bsp\_Integral::Integral\_makelist}}(\mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}} len) \{}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00076}00076     \mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}} = (\textcolor{keywordtype}{float}*)malloc(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{float})* len);}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00077}00077     \mbox{\hyperlink{classbsp___integral_a662c735b9432a46e48a642ebb9c0e8fa}{result\_len}} = len;}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00078}00078     \mbox{\hyperlink{classbsp___integral_aae2b6143ca39861a83b77befc131bf5e}{Integral\_clslist}}();}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00079}00079     \textcolor{keywordflow}{return} (\mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}})\mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}};\}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00080}00080 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00086}\mbox{\hyperlink{classbsp___integral_a80693e18b9b9509bdec0ebfd72f84072}{00086}} \textcolor{comment}{}\textcolor{keywordtype}{float} \mbox{\hyperlink{classbsp___integral_a80693e18b9b9509bdec0ebfd72f84072}{bsp\_Integral::Integral\_list}}(\textcolor{keywordtype}{float} var) \{}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00087}00087     \textcolor{keyword}{static} \mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}} len=0;}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00088}00088     \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{results}} += var * \mbox{\hyperlink{classbsp___integral_a4494cf9fc2873d457ed3bf8618b68045}{dt}};}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00089}00089     \textcolor{comment}{//  保存历史}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00090}00090     \mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}}[len] = var * \mbox{\hyperlink{classbsp___integral_a4494cf9fc2873d457ed3bf8618b68045}{dt}};}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00091}00091     \textcolor{comment}{//  轮盘转}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00092}00092     ++len;}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00093}00093     \textcolor{keywordflow}{if} (len == \mbox{\hyperlink{classbsp___integral_a662c735b9432a46e48a642ebb9c0e8fa}{result\_len}})len = 0;}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00094}00094     \textcolor{comment}{//  去除尾值}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00095}00095     \textcolor{keywordflow}{if} (len < \mbox{\hyperlink{classbsp___integral_a662c735b9432a46e48a642ebb9c0e8fa}{result\_len}} -\/ 1)}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00096}00096         \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{results}} -\/= \mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}}[len + 1];}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00097}00097     \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00098}00098         \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{results}} -\/= \mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}}[0];}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00099}00099     \textcolor{comment}{//  }}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00100}00100     \textcolor{keywordflow}{return} \mbox{\hyperlink{classbsp___integral_a910f1f3faa2b4963e00718472b8389bc}{results}};\}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00101}00101 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00105}\mbox{\hyperlink{classbsp___integral_a47307ddf418d2686245b118dcf61a199}{00105}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___integral_a47307ddf418d2686245b118dcf61a199}{bsp\_Integral::Integral\_dellist}}(\textcolor{keywordtype}{void}) \{}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00106}00106     free(\mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}});}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00107}00107     \mbox{\hyperlink{classbsp___integral_a662c735b9432a46e48a642ebb9c0e8fa}{result\_len}} = 0;}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00108}00108     \mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}} = NULL;\}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00109}00109 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00113}\mbox{\hyperlink{classbsp___integral_aae2b6143ca39861a83b77befc131bf5e}{00113}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___integral_aae2b6143ca39861a83b77befc131bf5e}{bsp\_Integral::Integral\_clslist}}(\textcolor{keywordtype}{void}) \{}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00114}00114     \textcolor{keywordflow}{if} (\mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}} == NULL)\textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00115}00115     \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}} i = 0; i < \mbox{\hyperlink{classbsp___integral_a662c735b9432a46e48a642ebb9c0e8fa}{result\_len}}; i++)}
\DoxyCodeLine{\Hypertarget{bsp___calculus_8cpp_source_l00116}00116         \mbox{\hyperlink{classbsp___integral_a656d90c5a713abf0665f1dcbf1a5101a}{result\_list}}[i] = 0;\}}

\end{DoxyCode}
