\doxysection{bench\+\_\+time.\+h}
\hypertarget{bench__time_8h_source}{}\label{bench__time_8h_source}\index{E:/.WORK/STM32/STM32\_ExtendedLibs/MyLibs/Inc/bench\_time.h@{E:/.WORK/STM32/STM32\_ExtendedLibs/MyLibs/Inc/bench\_time.h}}
\mbox{\hyperlink{bench__time_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00001}00001\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00002}00002\ \textcolor{comment}{******************************************************************************}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00003}00003\ \textcolor{comment}{*\ @file\ bench\_time.h}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Заголовочный\ файл\ для\ измерения\ времени\ между\ событиями}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00005}00005\ \textcolor{comment}{******************************************************************************}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00006}00006\ \textcolor{comment}{*\ @addtogroup\ BENCH\_TIME\ \ \ \ Time\ measurement}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00007}00007\ \textcolor{comment}{*\ @ingroup\ \ \ \ MYLIBS\_DEFINES}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00008}00008\ \textcolor{comment}{*\ @brief\ \ \ \ \ \ Библиотека\ для\ измерения\ времени/тиков\ между\ событиями}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00009}00009\ \textcolor{comment}{*\ @details}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00010}00010\ \textcolor{comment}{Поддерживает:}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00011}00011\ \textcolor{comment}{-\/\ Многоканальные\ измерения\ (несколько\ независимых\ таймеров)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00012}00012\ \textcolor{comment}{-\/\ Платформонезависимый\ интерфейс}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00013}00013\ \textcolor{comment}{-\/\ Измерение\ в\ тиках\ или\ временных\ единицах}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00014}00014\ \textcolor{comment}{-\/\ Статистику\ измерений\ (мин/макс/среднее)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00015}00015\ \textcolor{comment}{-\/\ Настраиваемый\ размер\ тиков\ для\ каждого\ канала}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00016}00016\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00017}00017\ \textcolor{comment}{Параметры\ для\ конфигурации:}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00018}00018\ \textcolor{comment}{-\/\ @ref\ BENCH\_TIME\_ENABLE\ -\/\ Включить\ бенч\ времени}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00019}00019\ \textcolor{comment}{-\/\ @ref\ BENCH\_TIME\_MAX\_CHANNELS\ -\/\ Максимальное\ количество\ каналов\ измерения\ (по\ умолчанию\ 8)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00020}00020\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00021}00021\ \textcolor{comment}{@par\ Пример\ использования:}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00022}00022\ \textcolor{comment}{@code}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00023}00023\ \textcolor{comment}{\#include\ "{}bench\_time.h"{}}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00024}00024\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00025}00025\ \textcolor{comment}{//\ Инициализация}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00026}00026\ \textcolor{comment}{BenchTime\_Init();}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00027}00027\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00028}00028\ \textcolor{comment}{//\ Измерение\ с\ SysTick}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00029}00029\ \textcolor{comment}{BenchTime\_Start(0,\ HAL\_GetTick,\ 0xFFFFFFFF);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00030}00030\ \textcolor{comment}{some\_function();}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00031}00031\ \textcolor{comment}{uint32\_t\ time\ =\ BenchTime\_End(0,\ HAL\_GetTick);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00032}00032\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00033}00033\ \textcolor{comment}{//\ Измерение\ с\ TIM2\ (16-\/бит)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00034}00034\ \textcolor{comment}{BenchTime\_Start(1,\ TIM2-\/>CNT,\ 0xFFFF);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00035}00035\ \textcolor{comment}{fast\_function();\ }}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00036}00036\ \textcolor{comment}{uint32\_t\ time2\ =\ BenchTime\_End(1,\ TIM2-\/>CNT);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00037}00037\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00038}00038\ \textcolor{comment}{//\ Измерение\ с\ DWT\ цикловым\ счетчиком}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00039}00039\ \textcolor{comment}{BenchTime\_Start(2,\ DWT-\/>CYCCNT,\ 0xFFFFFFFF);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00040}00040\ \textcolor{comment}{critical\_function();}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00041}00041\ \textcolor{comment}{uint32\_t\ cycles\ =\ BenchTime\_End(2,\ DWT-\/>CYCCNT);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00042}00042\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00043}00043\ \textcolor{comment}{//\ Многоканальное\ измерение}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00044}00044\ \textcolor{comment}{BenchTime\_Start(0,\ HAL\_GetTick,\ 1000);\ \ \ \ \ \ \ \ //\ общее\ время}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00045}00045\ \textcolor{comment}{BenchTime\_Start(1,\ TIM3-\/>CNT,\ 500);\ \ \ \ \ \ \ \ \ \ \ //\ часть\ 1}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00046}00046\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00047}00047\ \textcolor{comment}{//\ ...\ код\ 1}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00048}00048\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00049}00049\ \textcolor{comment}{uint32\_t\ part1\ =\ BenchTime\_End(1,\ TIM3-\/>CNT);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00050}00050\ \textcolor{comment}{BenchTime\_Start(2,\ TIM4-\/>CNT,\ 200);\ \ \ \ \ \ \ \ \ \ \ //\ часть\ 2\ \ }}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00051}00051\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00052}00052\ \textcolor{comment}{//\ ...\ код\ 2}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00053}00053\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00054}00054\ \textcolor{comment}{uint32\_t\ part2\ =\ BenchTime\_End(2,\ TIM4-\/>CNT);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00055}00055\ \textcolor{comment}{uint32\_t\ total\ =\ BenchTime\_End(0,\ HAL\_GetTick);\ //\ общее\ время}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00056}00056\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00057}00057\ \textcolor{comment}{//\ Статистика}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00058}00058\ \textcolor{comment}{uint32\_t\ min\_time\ =\ BenchTime\_GetMin(0);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00059}00059\ \textcolor{comment}{uint32\_t\ max\_time\ =\ BenchTime\_GetMax(0);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00060}00060\ \textcolor{comment}{uint32\_t\ avg\_time\ =\ BenchTime\_GetAverage(0);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00061}00061\ \textcolor{comment}{uint32\_t\ count\ =\ BenchTime\_GetCount(0);}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00062}00062\ \textcolor{comment}{@endcode}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00063}00063\ \textcolor{comment}{*\ @\{\ \ }}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00064}00064\ \textcolor{comment}{*****************************************************************************/}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00065}00065\ \textcolor{preprocessor}{\#ifndef\ \_\_BENCH\_TIME\_H\_}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00066}00066\ \textcolor{preprocessor}{\#define\ \_\_BENCH\_TIME\_H\_}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00067}00067\ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00068}00068\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{mylibs__defs_8h}{mylibs\_defs.h}}"{}}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00069}00069\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00070}00070\ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00071}00071\ \textcolor{preprocessor}{\#ifdef\ BENCH\_TIME\_ENABLE}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00072}00072\ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00073}00073\ \textcolor{comment}{//\ Конфигурация\ библиотеки}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00074}00074\ \textcolor{preprocessor}{\#ifndef\ BENCH\_TIME\_MAX\_CHANNELS}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00075}00075\ \textcolor{preprocessor}{\#define\ BENCH\_TIME\_MAX\_CHANNELS\ \ 8\ \ \ \ }\textcolor{comment}{///<\ Максимальное\ количество\ каналов\ измерения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00076}00076\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00077}00077\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00078}00078\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00079}00079\ \textcolor{comment}{\ \ *\ @brief\ Структура\ статистики\ измерений}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00080}00080\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00081}\mbox{\hyperlink{struct_bench_time_stats__t}{00081}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00082}\mbox{\hyperlink{struct_bench_time_stats__t_a39b71a5d48c4a51a553a26a9fb961ac8}{00082}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_stats__t_a39b71a5d48c4a51a553a26a9fb961ac8}{min\_ticks}};\ \ \ \ \ \ \textcolor{comment}{///<\ Минимальное\ время\ в\ тиках}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00083}\mbox{\hyperlink{struct_bench_time_stats__t_a3da36eb65b03ba995b5905b4650ea93c}{00083}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_stats__t_a3da36eb65b03ba995b5905b4650ea93c}{max\_ticks}};\ \ \ \ \ \ \textcolor{comment}{///<\ Максимальное\ время\ в\ тиках\ \ }}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00084}\mbox{\hyperlink{struct_bench_time_stats__t_a21499b0b19d1ed27f8cea069f674e8ec}{00084}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_stats__t_a21499b0b19d1ed27f8cea069f674e8ec}{total\_ticks}};\ \ \ \ \textcolor{comment}{///<\ Суммарное\ время\ в\ тиках}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00085}\mbox{\hyperlink{struct_bench_time_stats__t_a5e95ef31dd0daf973894ef2f034d1f71}{00085}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_stats__t_a5e95ef31dd0daf973894ef2f034d1f71}{count}};\ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Количество\ измерений}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00086}\mbox{\hyperlink{struct_bench_time_stats__t_a2c739e1db6b26ceac5db3f2c44c177a0}{00086}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_stats__t_a2c739e1db6b26ceac5db3f2c44c177a0}{last\_ticks}};\ \ \ \ \ \textcolor{comment}{///<\ Последнее\ измеренное\ время}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00087}00087\ \}\ \mbox{\hyperlink{struct_bench_time_stats__t}{BenchTimeStats\_t}};}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00088}00088\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00089}00089\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00090}00090\ \textcolor{comment}{\ \ *\ @brief\ Структура\ канала\ измерения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00091}00091\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00092}\mbox{\hyperlink{struct_bench_time_channel__t}{00092}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00093}\mbox{\hyperlink{struct_bench_time_channel__t_a8140fe9e3d323404651f0cfeeae53928}{00093}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_channel__t_a8140fe9e3d323404651f0cfeeae53928}{start\_tick}};\ \ \ \ \ \textcolor{comment}{///<\ Время\ старта\ в\ тиках}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00094}\mbox{\hyperlink{struct_bench_time_channel__t_a095d93e0228641f58b8661e263bc1bcd}{00094}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_channel__t_a095d93e0228641f58b8661e263bc1bcd}{tick\_period}};\ \ \ \ \textcolor{comment}{///<\ Период\ тиков\ для\ переполнения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00095}\mbox{\hyperlink{struct_bench_time_channel__t_a0f80bb194231df7921712d20bac603c9}{00095}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_bench_time_channel__t_a0f80bb194231df7921712d20bac603c9}{is\_running}};\ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Флаг\ активного\ измерения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00096}\mbox{\hyperlink{struct_bench_time_channel__t_a22a3913e7925aa89cc12ec1d24a6c16c}{00096}}\ \ \ \mbox{\hyperlink{struct_bench_time_stats__t}{BenchTimeStats\_t}}\ \mbox{\hyperlink{struct_bench_time_channel__t_a22a3913e7925aa89cc12ec1d24a6c16c}{stats}};\ \ \textcolor{comment}{///<\ Статистика\ измерений}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00097}00097\ \}\ \mbox{\hyperlink{struct_bench_time_channel__t}{BenchTimeChannel\_t}};}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00098}00098\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00099}00099\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00100}00100\ \textcolor{comment}{\ \ *\ @brief\ Основная\ структура\ менеджера\ измерений}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00101}00101\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00102}\mbox{\hyperlink{struct_bench_time__t}{00102}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00103}\mbox{\hyperlink{struct_bench_time__t_a9ae6d45c610be9d4b7628a614ccb06d6}{00103}}\ \ \ \mbox{\hyperlink{struct_bench_time_channel__t}{BenchTimeChannel\_t}}\ \mbox{\hyperlink{struct_bench_time__t_a9ae6d45c610be9d4b7628a614ccb06d6}{channels}}[\mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}}];\ \textcolor{comment}{///<\ Каналы\ измерения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00104}00104\ \}\ \mbox{\hyperlink{struct_bench_time__t}{BenchTime\_t}};}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00105}00105\ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00106}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{00106}}\ \textcolor{keyword}{static}\ \mbox{\hyperlink{struct_bench_time__t}{BenchTime\_t}}\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}\ =\ \{0\};\ \textcolor{comment}{///<\ Внутренний\ экземпляр}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00107}00107\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00108}00108\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00109}00109\ \textcolor{comment}{\ \ *\ @brief\ Инициализация\ системы\ измерения\ времени}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00110}00110\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00111}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gabb7a665a9603ea2e4dbc4432e8cb6054}{00111}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gabb7a665a9603ea2e4dbc4432e8cb6054}{BenchTime\_Init}}(\textcolor{keywordtype}{void})\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00112}00112\ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}};\ i++)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00113}00113\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].start\_tick\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00114}00114\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].tick\_period\ =\ 0xFFFFFFFF;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00115}00115\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].is\_running\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00116}00116\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].stats.min\_ticks\ =\ 0xFFFFFFFF;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00117}00117\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].stats.max\_ticks\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00118}00118\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].stats.total\_ticks\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00119}00119\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].stats.count\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00120}00120\ \ \ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[i].stats.last\_ticks\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00121}00121\ \ \ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00122}00122\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00123}00123\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00124}00124\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00125}00125\ \textcolor{comment}{\ \ *\ @brief\ Начало\ измерения\ на\ указанном\ канале}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00126}00126\ \textcolor{comment}{\ \ *\ @param\ channel\ Номер\ канала\ (0..BENCH\_TIME\_MAX\_CHANNELS-\/1)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00127}00127\ \textcolor{comment}{\ \ *\ @param\ ticks\ Источник\ тиков\ (например:\ HAL\_GetTick(),\ TIM2-\/>CNT,\ DWT-\/>CYCCNT)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00128}00128\ \textcolor{comment}{\ \ *\ @param\ tick\_period\ Период\ тиков\ для\ переполнения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00129}00129\ \textcolor{comment}{\ \ *\ @return\ 1\ -\/\ успех,\ 0\ -\/\ ошибка}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00130}00130\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00131}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gac65338df38129964ce3e9d9cb2fcb349}{00131}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ uint32\_t\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gac65338df38129964ce3e9d9cb2fcb349}{BenchTime\_Start}}(uint8\_t\ channel,\ uint32\_t\ ticks,\ uint32\_t\ tick\_period)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00132}00132\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00133}00133\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].is\_running)\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00134}00134\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00135}00135\ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].start\_tick\ =\ ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00136}00136\ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].tick\_period\ =\ tick\_period;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00137}00137\ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].is\_running\ =\ 1;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00138}00138\ \ \ \textcolor{keywordflow}{return}\ 1;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00139}00139\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00140}00140\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00141}00141\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00142}00142\ \textcolor{comment}{\ \ *\ @brief\ Окончание\ измерения\ на\ указанном\ канале}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00143}00143\ \textcolor{comment}{\ \ *\ @param\ channel\ Номер\ канала\ (0..BENCH\_TIME\_MAX\_CHANNELS-\/1)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00144}00144\ \textcolor{comment}{\ \ *\ @param\ ticks\ Источник\ тиков\ (должен\ быть\ тот\ же\ что\ в\ Start)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00145}00145\ \textcolor{comment}{\ \ *\ @return\ Измеренное\ время\ в\ тиках,\ 0\ -\/\ в\ случае\ ошибки}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00146}00146\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00147}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga47a69851a2089140eac00cde18a12439}{00147}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ uint32\_t\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga47a69851a2089140eac00cde18a12439}{BenchTime\_End}}(uint8\_t\ channel,\ uint32\_t\ ticks)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00148}00148\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00149}00149\ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].is\_running)\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00150}00150\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00151}00151\ \ \ uint32\_t\ end\_tick\ =\ ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00152}00152\ \ \ uint32\_t\ start\_tick\ =\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].start\_tick;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00153}00153\ \ \ uint32\_t\ tick\_period\ =\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].tick\_period;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00154}00154\ \ \ uint32\_t\ elapsed\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00155}00155\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00156}00156\ \ \ \textcolor{keywordflow}{if}\ (end\_tick\ >=\ start\_tick)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00157}00157\ \ \ \ \ elapsed\_ticks\ =\ end\_tick\ -\/\ start\_tick;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00158}00158\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00159}00159\ \ \ \ \ elapsed\_ticks\ =\ (tick\_period\ -\/\ start\_tick)\ +\ end\_tick\ +\ 1;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00160}00160\ \ \ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00161}00161\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00162}00162\ \ \ \textcolor{keywordflow}{if}\ (elapsed\_ticks\ >\ tick\_period)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00163}00163\ \ \ \ \ elapsed\_ticks\ =\ tick\_period;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00164}00164\ \ \ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00165}00165\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00166}00166\ \ \ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].is\_running\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00167}00167\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00168}00168\ \ \ \textcolor{comment}{//\ Обновление\ статистики}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00169}00169\ \ \ \mbox{\hyperlink{struct_bench_time_stats__t}{BenchTimeStats\_t}}*\ stats\ =\ \&\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].stats;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00170}00170\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a2c739e1db6b26ceac5db3f2c44c177a0}{last\_ticks}}\ =\ elapsed\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00171}00171\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00172}00172\ \ \ \textcolor{keywordflow}{if}\ (elapsed\_ticks\ <\ stats-\/>min\_ticks)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00173}00173\ \ \ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a39b71a5d48c4a51a553a26a9fb961ac8}{min\_ticks}}\ =\ elapsed\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00174}00174\ \ \ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00175}00175\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00176}00176\ \ \ \textcolor{keywordflow}{if}\ (elapsed\_ticks\ >\ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a3da36eb65b03ba995b5905b4650ea93c}{max\_ticks}})\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00177}00177\ \ \ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a3da36eb65b03ba995b5905b4650ea93c}{max\_ticks}}\ =\ elapsed\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00178}00178\ \ \ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00179}00179\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00180}00180\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a21499b0b19d1ed27f8cea069f674e8ec}{total\_ticks}}\ +=\ elapsed\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00181}00181\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a5e95ef31dd0daf973894ef2f034d1f71}{count}}++;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00182}00182\ \ \ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00183}00183\ \ \ \textcolor{keywordflow}{return}\ elapsed\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00184}00184\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00185}00185\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00186}00186\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00187}00187\ \textcolor{comment}{\ \ *\ @brief\ Получение\ минимального\ времени\ измерения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00188}00188\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00189}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga273d45255fe4403fc25648d60cca7705}{00189}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ uint32\_t\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga273d45255fe4403fc25648d60cca7705}{BenchTime\_GetMin}}(uint8\_t\ channel)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00190}00190\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00191}00191\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].stats.min\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00192}00192\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00193}00193\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00194}00194\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00195}00195\ \textcolor{comment}{\ \ *\ @brief\ Получение\ максимального\ времени\ измерения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00196}00196\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00197}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga07e27d7b169c9fa1abd57281bb4e374e}{00197}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ uint32\_t\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga07e27d7b169c9fa1abd57281bb4e374e}{BenchTime\_GetMax}}(uint8\_t\ channel)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00198}00198\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00199}00199\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].stats.max\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00200}00200\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00201}00201\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00202}00202\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00203}00203\ \textcolor{comment}{\ \ *\ @brief\ Получение\ среднего\ времени\ измерения}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00204}00204\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00205}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga24e2450d5ea921074ec5d7a1e4d56ba8}{00205}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ uint32\_t\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga24e2450d5ea921074ec5d7a1e4d56ba8}{BenchTime\_GetAverage}}(uint8\_t\ channel)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00206}00206\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00207}00207\ \ \ \mbox{\hyperlink{struct_bench_time_stats__t}{BenchTimeStats\_t}}*\ stats\ =\ \&\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].stats;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00208}00208\ \ \ \textcolor{keywordflow}{if}\ (stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a5e95ef31dd0daf973894ef2f034d1f71}{count}}\ ==\ 0)\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00209}00209\ \ \ \textcolor{keywordflow}{return}\ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a21499b0b19d1ed27f8cea069f674e8ec}{total\_ticks}}\ /\ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a5e95ef31dd0daf973894ef2f034d1f71}{count}};}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00210}00210\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00211}00211\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00212}00212\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00213}00213\ \textcolor{comment}{\ \ *\ @brief\ Получение\ количества\ измерений}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00214}00214\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00215}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gabd1301ca79a30c782970f89fd147df3a}{00215}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ uint32\_t\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gabd1301ca79a30c782970f89fd147df3a}{BenchTime\_GetCount}}(uint8\_t\ channel)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00216}00216\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00217}00217\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].stats.count;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00218}00218\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00219}00219\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00220}00220\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00221}00221\ \textcolor{comment}{\ \ *\ @brief\ Получение\ последнего\ измеренного\ времени}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00222}00222\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00223}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gacf3a738d6423d71b238058a63558a4ed}{00223}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ uint32\_t\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_gacf3a738d6423d71b238058a63558a4ed}{BenchTime\_GetLast}}(uint8\_t\ channel)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00224}00224\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00225}00225\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].stats.last\_ticks;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00226}00226\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00227}00227\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00228}00228\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00229}00229\ \textcolor{comment}{\ \ *\ @brief\ Сброс\ статистики\ для\ канала}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00230}00230\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00231}\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga31a6b2b181b92bcb15f46758f5d57f35}{00231}}\ \textcolor{keyword}{static}\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga31a6b2b181b92bcb15f46758f5d57f35}{BenchTime\_ResetStats}}(uint8\_t\ channel)\ \{}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00232}00232\ \ \ \textcolor{keywordflow}{if}\ (channel\ >=\ \mbox{\hyperlink{group___g_e_n___c_o_n_f_i_g_ga74fdf777ceefa5e7d67120fbda4cde52}{BENCH\_TIME\_MAX\_CHANNELS}})\ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00233}00233\ \ \ \mbox{\hyperlink{struct_bench_time_stats__t}{BenchTimeStats\_t}}*\ stats\ =\ \&\mbox{\hyperlink{group___b_e_n_c_h___t_i_m_e_ga8e53ef7f7df233bd4e737a87bb203d9d}{hbt}}.channels[channel].stats;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00234}00234\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a39b71a5d48c4a51a553a26a9fb961ac8}{min\_ticks}}\ =\ 0xFFFFFFFF;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00235}00235\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a3da36eb65b03ba995b5905b4650ea93c}{max\_ticks}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00236}00236\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a21499b0b19d1ed27f8cea069f674e8ec}{total\_ticks}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00237}00237\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a5e95ef31dd0daf973894ef2f034d1f71}{count}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00238}00238\ \ \ stats-\/>\mbox{\hyperlink{struct_bench_time_stats__t_a2c739e1db6b26ceac5db3f2c44c177a0}{last\_ticks}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00239}00239\ \}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00240}00240\ \textcolor{preprocessor}{\#else\ }\textcolor{comment}{//BENCH\_TIME\_ENABLE}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00241}00241\ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00242}00242\ \textcolor{preprocessor}{\#define\ BenchTime\_Init()}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00243}00243\ \textcolor{preprocessor}{\#define\ BenchTime\_Start(channel,\ ticks,\ tick\_period)\ \ 0}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00244}00244\ \textcolor{preprocessor}{\#define\ BenchTime\_End(channel,\ ticks)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00245}00245\ \textcolor{preprocessor}{\#define\ BenchTime\_GetMin(channel)\ \ \ \ \ \ \ 0}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00246}00246\ \textcolor{preprocessor}{\#define\ BenchTime\_GetMax(channel)\ \ \ \ \ \ \ 0}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00247}00247\ \textcolor{preprocessor}{\#define\ BenchTime\_GetAverage(channel)\ \ \ 0}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00248}00248\ \textcolor{preprocessor}{\#define\ BenchTime\_GetCount(channel)\ \ \ \ \ 0}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00249}00249\ \textcolor{preprocessor}{\#define\ BenchTime\_GetLast(channel)\ \ \ \ \ \ 0}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00250}00250\ \textcolor{preprocessor}{\#define\ BenchTime\_ResetStats(channel)}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00251}00251\ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00252}00252\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//BENCH\_TIME\_ENABLE}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00253}00253\ }
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00254}00254\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_BENCH\_TIME\_H\_}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00255}00255\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00256}00256\ \textcolor{comment}{/**\ BENCH\_TIME}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00257}00257\ \textcolor{comment}{\ \ *\ @\}}}
\DoxyCodeLine{\Hypertarget{bench__time_8h_source_l00258}00258\ \textcolor{comment}{\ \ */}}

\end{DoxyCode}
