Добавлен модуль для оптимизации по эволюционному алгоритму
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00003}00003\ \textcolor{comment}{*\ @file\ mylibs\_defs.h}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Заголочный\ файл\ для\ дефайнов\ библиотеки\ MyLibsGeneral.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00006}00006\ \textcolor{comment}{*\ @defgroup\ MYLIBS\_DEFINES\ \ General\ Defines}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00006}00006\ \textcolor{comment}{*\ @defgroup\ MYLIBS\_DEFINES\ \ General\ Tools}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00007}00007\ \textcolor{comment}{*\ @ingroup\ \ MYLIBS\_ALL}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00008}00008\ \textcolor{comment}{*\ @brief\ \ \ \ Общие\ макросы\ и\ typedef'ы,\ используемые\ по\ всему\ проекту}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00009}00009\ \textcolor{comment}{*}}
|
||||
@@ -59,135 +59,132 @@
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00055}00055\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00056}00056\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00057}00057\ \textcolor{comment}{/***************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00058}00058\ \textcolor{comment}{********************************ACCESS\_DEFINES*****************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00059}00059\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00060}00060\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00061}00061\ \textcolor{comment}{/***************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00062}00062\ \textcolor{comment}{******************************DELAYS\_DEFINES*******************************/}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00063}00063\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00064}00064\ \textcolor{comment}{\ \ *\ @addtogroup\ DELAYS\_DEFINES\ \ \ \ Delays\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00065}00065\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ MYLIBS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00066}00066\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ \ Макросы\ и\ определения\ для\ работы\ с\ задержками\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00067}00067\ \textcolor{comment}{\ \ *\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00068}00068\ \textcolor{comment}{\ \ *\ Этот\ блок\ содержит\ макросы\ для\ реализации\ задержек\ с\ использованием\ HAL\ или\ FreeRTOS:}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00069}00069\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelay\ \ \ \ \ \ \ \ \ \ \ \ \ —\ простая\ задержка\ заданной\ длительности;}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00070}00070\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelayStart\ \ \ \ \ \ \ \ —\ сохранение\ текущего\ времени\ начала\ задержки;}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00071}00071\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelayWhileActive\ \ —\ проверка,\ активна\ ли\ задержка;}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00072}00072\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelayWaitDone\ \ \ \ \ —\ проверка,\ завершена\ ли\ задержка.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00073}00073\ \textcolor{comment}{\ \ *\ Эти\ макросы\ удобны\ для\ реализации\ неблокирующих\ задержек.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00074}00074\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00075}00075\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00076}00076\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00077}00077\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00078}00078\ \textcolor{comment}{\ \ *\ @def\ msDelay(\_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00079}00079\ \textcolor{comment}{\ \ *\ @brief\ Задержка\ на\ указанное\ количество\ миллисекунд.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00080}00080\ \textcolor{comment}{\ \ *\ @param\ \_ms\_\ Время\ задержки\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00081}00081\ \textcolor{comment}{\ \ *\ @note\ Использует\ HAL\_Delay\ или\ osDelay\ в\ зависимости\ от\ @ref\ FREERTOS\_DELAY.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00082}00082\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00083}00083\ \textcolor{preprocessor}{\#ifdef\ FREERTOS\_DELAY}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00084}00084\ \textcolor{preprocessor}{\ \ \#define\ msDelay(\_ms\_)\ \ \ \ \ \ \ osDelay(\_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00085}00085\ \textcolor{preprocessor}{\#else}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00086}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_gabeb97579daeb622c6651ed03c4a27479}{00086}}\ \textcolor{preprocessor}{\ \ \#define\ msDelay(\_ms\_)\ \ \ \ \ \ \ HAL\_Delay(\_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00087}00087\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00088}00088\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00089}00089\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00090}00090\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00091}00091\ \textcolor{comment}{\ \ *\ @brief\ Начать\ отсчет\ задержки.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00092}00092\ \textcolor{comment}{\ \ *\ @param\ \_pvar\_\ Указатель\ на\ переменную\ типа\ uint32\_t\ для\ хранения\ времени\ старта.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00093}00093\ \textcolor{comment}{\ \ *\ @details\ После\ вызова\ этого\ макроса\ переменная\ \_pvar\_\ содержит\ текущее\ количество\ миллисекунд}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00094}00094\ \textcolor{comment}{\ \ *\ с\ момента\ запуска\ системы\ (HAL\_GetTick).\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00095}00095\ \textcolor{comment}{\ \ *\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00096}00096\ \textcolor{comment}{\ \ *\ Используется\ для\ реализации\ неблокирующих\ задержек.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00097}00097\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00098}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_ga8a5051b1292d1019fe8dd3fc5521ab25}{00098}}\ \textcolor{preprocessor}{\#define\ msDelayStart(\_pvar\_)\ \ \ \ \ \ \ \ \ \ \ \ *(\_pvar\_)\ =\ HAL\_GetTick()}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00099}00099\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00100}00100\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00101}00101\ \textcolor{comment}{\ *\ @brief\ Проверяет,\ активна\ ли\ задержка.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00102}00102\ \textcolor{comment}{\ *\ @param\ \_ms\_\ Длительность\ задержки\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00103}00103\ \textcolor{comment}{\ *\ @param\ \_pvar\_\ Указатель\ на\ переменную,\ в\ которой\ сохранено\ время\ начала\ (@ref\ msDelayStart).}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00104}00104\ \textcolor{comment}{\ *\ @retval\ 1\ Задержка\ еще\ активна.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00105}00105\ \textcolor{comment}{\ *\ @retval\ 0\ Задержка\ завершена.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00106}00106\ \textcolor{comment}{\ *\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00107}00107\ \textcolor{comment}{\ *\ Возвращает\ true,\ пока\ время\ задержки\ не\ истекло.\ Используется\ в\ проверках,}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00108}00108\ \textcolor{comment}{\ *\ когда\ нужно\ **действовать,\ пока\ задержка\ выполняется**.\ Пример:}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00109}00109\ \textcolor{comment}{\ *\ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00110}00110\ \textcolor{comment}{\ *\ while(msDelayWhileActive(1000,\ \&tick))\ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00111}00111\ \textcolor{comment}{\ *\ \ \ \ \ //\ выполняем\ другие\ задачи,\ задержка\ не\ блокирует\ поток}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00112}00112\ \textcolor{comment}{\ *\ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00113}00113\ \textcolor{comment}{\ *\ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00114}00114\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00115}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_ga0b97e172659a59ee4fa56f851643ae85}{00115}}\ \textcolor{preprocessor}{\#define\ msDelayWhileActive(\_ms\_,\ \_pvar\_)\ \ \ \ (HAL\_GetTick()\ -\/\ *(\_pvar\_)\ <\ \_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00116}00116\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00117}00117\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00118}00118\ \textcolor{comment}{\ *\ @brief\ Проверяет,\ завершилась\ ли\ задержка.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00119}00119\ \textcolor{comment}{\ *\ @param\ \_ms\_\ Длительность\ задержки\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00120}00120\ \textcolor{comment}{\ *\ @param\ \_pvar\_\ Указатель\ на\ переменную,\ в\ которой\ сохранено\ время\ начала\ (msDelayStart).}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00121}00121\ \textcolor{comment}{\ *\ @retval\ 1\ Задержка\ завершена.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00122}00122\ \textcolor{comment}{\ *\ @retval\ 0\ Задержка\ еще\ активна.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00123}00123\ \textcolor{comment}{\ *\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00124}00124\ \textcolor{comment}{\ *\ Возвращает\ true,\ когда\ задержка\ уже\ завершена.\ Используется\ в\ проверках,}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00125}00125\ \textcolor{comment}{\ *\ когда\ нужно\ **выполнить\ действие\ только\ после\ окончания\ задержки**.\ Пример:}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00126}00126\ \textcolor{comment}{\ *\ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00127}00127\ \textcolor{comment}{\ *\ if(msDelayWaitDone(1000,\ \&tick))\ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00128}00128\ \textcolor{comment}{\ *\ \ \ \ \ //\ выполняем\ действие\ после\ завершения\ задержки}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00129}00129\ \textcolor{comment}{\ *\ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00130}00130\ \textcolor{comment}{\ *\ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00131}00131\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00132}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_gaed082c07b9fc4d1894330d885b9b5518}{00132}}\ \textcolor{preprocessor}{\#define\ msDelayWaitDone(\_ms\_,\ \_pvar\_)\ \ \ \ (HAL\_GetTick()\ -\/\ *(\_pvar\_)\ >=\ \_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00133}00133\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00134}00134\ \textcolor{comment}{/**\ DELAYS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00135}00135\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00136}00136\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00137}00137\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00138}00138\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00139}00139\ \textcolor{comment}{/***************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00140}00140\ \textcolor{comment}{*******************************MATH\_DEFINES********************************/}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00141}00141\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00142}00142\ \textcolor{comment}{\ \ *\ @addtogroup\ UTILS\_DEFINES\ \ \ \ \ \ Utils\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00143}00143\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ MYLIBS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00144}00144\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Общие\ вспомогательные\ макросы}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00145}00145\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00146}00146\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00147}00147\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00148}00148\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00149}00149\ \textcolor{comment}{\ *\ @brief\ Обнуление\ структуры.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00150}00150\ \textcolor{comment}{\ *\ @param\ \_struct\_\ Структура,\ которую\ нужно\ обнулить.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00151}00151\ \textcolor{comment}{\ *\ @details\ Макрос\ использует\ memset\ для\ обнуления\ всей\ памяти\ структуры.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00152}00152\ \textcolor{comment}{\ *\ Используется\ для\ быстрой\ и\ безопасной\ инициализации\ переменных\ структур\ до\ нуля.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00153}00153\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00154}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_gaf5e598848326d48e86167e5099a029be}{00154}}\ \textcolor{preprocessor}{\#define\ ClearStruct(\_struct\_)\ \ \ \ \ memset(\&(\_struct\_),\ 0,\ sizeof(\_struct\_))}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00155}00155\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00156}00156\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00157}00157\ \textcolor{comment}{\ \ *\ @brief\ \ Деление\ с\ округлением\ вверх}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00158}00158\ \textcolor{comment}{\ \ *\ @param\ \_val\_\ Делимое.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00159}00159\ \textcolor{comment}{\ \ *\ @param\ \_div\_\ Делитель.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00160}00160\ \textcolor{comment}{\ \ *\ @return\ Результат\ деления,\ округленный\ вверх.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00161}00161\ \textcolor{comment}{\ \ *\ @details\ \ Если\ результат\ деления\ без\ остатка:\ он\ возвращается\ как\ есть}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00162}00162\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ Если\ с\ остатком\ -\/\ округляется\ вверх}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00163}00163\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00164}00164\ \textcolor{comment}{//\#define\ Divide\_Up(\_val\_,\ \_div\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (((\_val\_)\%(\_div\_))?\ (\_val\_)/(\_div\_)+1\ :\ (\_val\_)/\_div\_)\ \ /*\ через\ тернарный\ оператор\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00165}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_gabf45f2b60eedf80cf9d1dbe4302a741e}{00165}}\ \textcolor{preprocessor}{\#define\ Divide\_Up(\_val\_,\ \_div\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ((\_val\_\ -\/\ 1)\ /\ \_div\_)\ +\ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ через\ мат\ выражение\ */}\textcolor{preprocessor}{\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00166}00166\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00167}00167\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00168}00168\ \textcolor{comment}{\ \ *\ @brief\ \ Swap\ between\ Little\ Endian\ and\ Big\ Endian}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00169}00169\ \textcolor{comment}{\ \ *\ @param\ v\ Исходное\ 16-\/битное\ значение.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00170}00170\ \textcolor{comment}{\ \ *\ @return\ Результат\ с\ поменяными\ местами\ старшим\ и\ младшим\ байтом.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00171}00171\ \textcolor{comment}{\ \ *\ @details\ \ Переключения\ между\ двумя\ типами\ хранения\ слова:\ HI-\/LO\ байты\ и\ LO-\/HI\ байты.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00172}00172\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00173}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_ga0f22e895ac7781c3d1b68fee182c4291}{00173}}\ \textcolor{preprocessor}{\#define\ ByteSwap16(v)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (((v\&0xFF00)\ >>\ (8))\ |\ ((v\&0x00FF)\ <<\ (8)))}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00174}00174\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00175}00175\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00176}00176\ \textcolor{comment}{\ \ *\ @brief\ \ Абсолютное\ значение\ числа}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00177}00177\ \textcolor{comment}{\ \ *\ @param\ x\ Число.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00178}00178\ \textcolor{comment}{\ \ *\ @return\ Абсолютное\ значение\ числа\ x.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00179}00179\ \textcolor{comment}{\ \ *\ @details\ \ Берет\ число\ по\ модулю.\ Хз\ как\ работает\ библиотечный\ abs\ в\ stdlib.h,\ мб\ это\ быстрее,\ но\ вряд\ ли\ конечно.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00180}00180\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00181}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_ga996f7be338ccb40d1a2a5abc1ad61759}{00181}}\ \textcolor{preprocessor}{\#define\ ABS(x)\ (\ ((x)\ >\ 0)?\ (x)\ :\ -\/(x))}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00182}00182\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00183}00183\ \textcolor{comment}{/**\ UTILS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00184}00184\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00185}00185\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00186}00186\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00187}00187\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\_\_MYLIBS\_DEFINES\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00058}00058\ \textcolor{comment}{******************************DELAYS\_DEFINES*******************************/}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00059}00059\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00060}00060\ \textcolor{comment}{\ \ *\ @addtogroup\ DELAYS\_DEFINES\ \ \ \ Delays\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00061}00061\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ MYLIBS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00062}00062\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ \ Макросы\ и\ определения\ для\ работы\ с\ задержками\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00063}00063\ \textcolor{comment}{\ \ *\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00064}00064\ \textcolor{comment}{\ \ *\ Этот\ блок\ содержит\ макросы\ для\ реализации\ задержек\ с\ использованием\ HAL\ или\ FreeRTOS:}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00065}00065\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelay\ \ \ \ \ \ \ \ \ \ \ \ \ —\ простая\ задержка\ заданной\ длительности;}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00066}00066\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelayStart\ \ \ \ \ \ \ \ —\ сохранение\ текущего\ времени\ начала\ задержки;}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00067}00067\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelayWhileActive\ \ —\ проверка,\ активна\ ли\ задержка;}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00068}00068\ \textcolor{comment}{\ \ *\ -\/\ @ref\ msDelayWaitDone\ \ \ \ \ —\ проверка,\ завершена\ ли\ задержка.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00069}00069\ \textcolor{comment}{\ \ *\ Эти\ макросы\ удобны\ для\ реализации\ неблокирующих\ задержек.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00070}00070\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00071}00071\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00072}00072\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00073}00073\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00074}00074\ \textcolor{comment}{\ \ *\ @def\ msDelay(\_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00075}00075\ \textcolor{comment}{\ \ *\ @brief\ Задержка\ на\ указанное\ количество\ миллисекунд.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00076}00076\ \textcolor{comment}{\ \ *\ @param\ \_ms\_\ Время\ задержки\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00077}00077\ \textcolor{comment}{\ \ *\ @note\ Использует\ HAL\_Delay\ или\ osDelay\ в\ зависимости\ от\ @ref\ FREERTOS\_DELAY.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00078}00078\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00079}00079\ \textcolor{preprocessor}{\#ifdef\ FREERTOS\_DELAY}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00080}00080\ \textcolor{preprocessor}{\ \ \#define\ msDelay(\_ms\_)\ \ \ \ \ \ \ osDelay(\_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00081}00081\ \textcolor{preprocessor}{\#else}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00082}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_gabeb97579daeb622c6651ed03c4a27479}{00082}}\ \textcolor{preprocessor}{\ \ \#define\ msDelay(\_ms\_)\ \ \ \ \ \ \ HAL\_Delay(\_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00083}00083\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00084}00084\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00085}00085\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00086}00086\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00087}00087\ \textcolor{comment}{\ \ *\ @brief\ Начать\ отсчет\ задержки.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00088}00088\ \textcolor{comment}{\ \ *\ @param\ \_pvar\_\ Указатель\ на\ переменную\ типа\ uint32\_t\ для\ хранения\ времени\ старта.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00089}00089\ \textcolor{comment}{\ \ *\ @details\ После\ вызова\ этого\ макроса\ переменная\ \_pvar\_\ содержит\ текущее\ количество\ миллисекунд}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00090}00090\ \textcolor{comment}{\ \ *\ с\ момента\ запуска\ системы\ (HAL\_GetTick).\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00091}00091\ \textcolor{comment}{\ \ *\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00092}00092\ \textcolor{comment}{\ \ *\ Используется\ для\ реализации\ неблокирующих\ задержек.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00093}00093\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00094}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_ga8a5051b1292d1019fe8dd3fc5521ab25}{00094}}\ \textcolor{preprocessor}{\#define\ msDelayStart(\_pvar\_)\ \ \ \ \ \ \ \ \ \ \ \ *(\_pvar\_)\ =\ HAL\_GetTick()}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00095}00095\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00096}00096\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00097}00097\ \textcolor{comment}{\ *\ @brief\ Проверяет,\ активна\ ли\ задержка.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00098}00098\ \textcolor{comment}{\ *\ @param\ \_ms\_\ Длительность\ задержки\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00099}00099\ \textcolor{comment}{\ *\ @param\ \_pvar\_\ Указатель\ на\ переменную,\ в\ которой\ сохранено\ время\ начала\ (@ref\ msDelayStart).}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00100}00100\ \textcolor{comment}{\ *\ @retval\ 1\ Задержка\ еще\ активна.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00101}00101\ \textcolor{comment}{\ *\ @retval\ 0\ Задержка\ завершена.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00102}00102\ \textcolor{comment}{\ *\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00103}00103\ \textcolor{comment}{\ *\ Возвращает\ true,\ пока\ время\ задержки\ не\ истекло.\ Используется\ в\ проверках,}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00104}00104\ \textcolor{comment}{\ *\ когда\ нужно\ **действовать,\ пока\ задержка\ выполняется**.\ Пример:}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00105}00105\ \textcolor{comment}{\ *\ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00106}00106\ \textcolor{comment}{\ *\ while(msDelayWhileActive(1000,\ \&tick))\ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00107}00107\ \textcolor{comment}{\ *\ \ \ \ \ //\ выполняем\ другие\ задачи,\ задержка\ не\ блокирует\ поток}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00108}00108\ \textcolor{comment}{\ *\ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00109}00109\ \textcolor{comment}{\ *\ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00110}00110\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00111}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_ga0b97e172659a59ee4fa56f851643ae85}{00111}}\ \textcolor{preprocessor}{\#define\ msDelayWhileActive(\_ms\_,\ \_pvar\_)\ \ \ \ (HAL\_GetTick()\ -\/\ *(\_pvar\_)\ <\ \_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00112}00112\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00113}00113\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00114}00114\ \textcolor{comment}{\ *\ @brief\ Проверяет,\ завершилась\ ли\ задержка.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00115}00115\ \textcolor{comment}{\ *\ @param\ \_ms\_\ Длительность\ задержки\ в\ миллисекундах.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00116}00116\ \textcolor{comment}{\ *\ @param\ \_pvar\_\ Указатель\ на\ переменную,\ в\ которой\ сохранено\ время\ начала\ (msDelayStart).}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00117}00117\ \textcolor{comment}{\ *\ @retval\ 1\ Задержка\ завершена.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00118}00118\ \textcolor{comment}{\ *\ @retval\ 0\ Задержка\ еще\ активна.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00119}00119\ \textcolor{comment}{\ *\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00120}00120\ \textcolor{comment}{\ *\ Возвращает\ true,\ когда\ задержка\ уже\ завершена.\ Используется\ в\ проверках,}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00121}00121\ \textcolor{comment}{\ *\ когда\ нужно\ **выполнить\ действие\ только\ после\ окончания\ задержки**.\ Пример:}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00122}00122\ \textcolor{comment}{\ *\ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00123}00123\ \textcolor{comment}{\ *\ if(msDelayWaitDone(1000,\ \&tick))\ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00124}00124\ \textcolor{comment}{\ *\ \ \ \ \ //\ выполняем\ действие\ после\ завершения\ задержки}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00125}00125\ \textcolor{comment}{\ *\ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00126}00126\ \textcolor{comment}{\ *\ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00127}00127\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00128}\mbox{\hyperlink{group___d_e_l_a_y_s___d_e_f_i_n_e_s_gaed082c07b9fc4d1894330d885b9b5518}{00128}}\ \textcolor{preprocessor}{\#define\ msDelayWaitDone(\_ms\_,\ \_pvar\_)\ \ \ \ (HAL\_GetTick()\ -\/\ *(\_pvar\_)\ >=\ \_ms\_)}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00129}00129\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00130}00130\ \textcolor{comment}{/**\ DELAYS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00131}00131\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00132}00132\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00133}00133\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00134}00134\ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00135}00135\ \textcolor{comment}{/***************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00136}00136\ \textcolor{comment}{*******************************UTIL\_DEFINES********************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00137}00137\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ dummy;\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00138}00138\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00139}00139\ \textcolor{comment}{\ \ *\ @addtogroup\ UTILS\_DEFINES\ \ \ \ \ \ Utils\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00140}00140\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ MYLIBS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00141}00141\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Общие\ вспомогательные\ макросы}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00142}00142\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00143}00143\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00144}00144\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00145}00145\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00146}00146\ \textcolor{comment}{\ *\ @brief\ Обнуление\ структуры.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00147}00147\ \textcolor{comment}{\ *\ @param\ \_struct\_\ Структура,\ которую\ нужно\ обнулить.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00148}00148\ \textcolor{comment}{\ *\ @details\ Макрос\ использует\ memset\ для\ обнуления\ всей\ памяти\ структуры.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00149}00149\ \textcolor{comment}{\ *\ Используется\ для\ быстрой\ и\ безопасной\ инициализации\ переменных\ структур\ до\ нуля.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00150}00150\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00151}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_gaf5e598848326d48e86167e5099a029be}{00151}}\ \textcolor{preprocessor}{\#define\ ClearStruct(\_struct\_)\ \ \ \ \ memset(\&(\_struct\_),\ 0,\ sizeof(\_struct\_))}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00152}00152\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00153}00153\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00154}00154\ \textcolor{comment}{\ \ *\ @brief\ \ Деление\ с\ округлением\ вверх}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00155}00155\ \textcolor{comment}{\ \ *\ @param\ \_val\_\ Делимое.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00156}00156\ \textcolor{comment}{\ \ *\ @param\ \_div\_\ Делитель.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00157}00157\ \textcolor{comment}{\ \ *\ @return\ Результат\ деления,\ округленный\ вверх.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00158}00158\ \textcolor{comment}{\ \ *\ @details\ \ Если\ результат\ деления\ без\ остатка:\ он\ возвращается\ как\ есть}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00159}00159\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ Если\ с\ остатком\ -\/\ округляется\ вверх}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00160}00160\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00161}00161\ \textcolor{comment}{//\#define\ Divide\_Up(\_val\_,\ \_div\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (((\_val\_)\%(\_div\_))?\ (\_val\_)/(\_div\_)+1\ :\ (\_val\_)/\_div\_)\ \ /*\ через\ тернарный\ оператор\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00162}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_gabf45f2b60eedf80cf9d1dbe4302a741e}{00162}}\ \textcolor{preprocessor}{\#define\ Divide\_Up(\_val\_,\ \_div\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ((\_val\_\ -\/\ 1)\ /\ \_div\_)\ +\ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{/*\ через\ мат\ выражение\ */}\textcolor{preprocessor}{\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00163}00163\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00164}00164\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00165}00165\ \textcolor{comment}{\ \ *\ @brief\ \ Swap\ between\ Little\ Endian\ and\ Big\ Endian}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00166}00166\ \textcolor{comment}{\ \ *\ @param\ v\ Исходное\ 16-\/битное\ значение.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00167}00167\ \textcolor{comment}{\ \ *\ @return\ Результат\ с\ поменяными\ местами\ старшим\ и\ младшим\ байтом.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00168}00168\ \textcolor{comment}{\ \ *\ @details\ \ Переключения\ между\ двумя\ типами\ хранения\ слова:\ HI-\/LO\ байты\ и\ LO-\/HI\ байты.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00169}00169\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00170}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_ga0f22e895ac7781c3d1b68fee182c4291}{00170}}\ \textcolor{preprocessor}{\#define\ ByteSwap16(v)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (((v\&0xFF00)\ >>\ (8))\ |\ ((v\&0x00FF)\ <<\ (8)))}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00171}00171\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00172}00172\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00173}00173\ \textcolor{comment}{\ \ *\ @brief\ \ Абсолютное\ значение\ числа}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00174}00174\ \textcolor{comment}{\ \ *\ @param\ x\ Число.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00175}00175\ \textcolor{comment}{\ \ *\ @return\ Абсолютное\ значение\ числа\ x.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00176}00176\ \textcolor{comment}{\ \ *\ @details\ \ Берет\ число\ по\ модулю.\ Хз\ как\ работает\ библиотечный\ abs\ в\ stdlib.h,\ мб\ это\ быстрее,\ но\ вряд\ ли\ конечно.}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00177}00177\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00178}\mbox{\hyperlink{group___u_t_i_l_s___d_e_f_i_n_e_s_ga996f7be338ccb40d1a2a5abc1ad61759}{00178}}\ \textcolor{preprocessor}{\#define\ ABS(x)\ (\ ((x)\ >\ 0)?\ (x)\ :\ -\/(x))}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00179}00179\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00180}00180\ \textcolor{comment}{/**\ UTILS\_DEFINES}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00181}00181\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00182}00182\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00183}00183\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{mylibs__defs_8h_source_l00184}00184\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\_\_MYLIBS\_DEFINES\_H\_}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
Reference in New Issue
Block a user