Чет работает
This commit is contained in:
136
AllLibs/MyLibs/__mylibs_include.h
Normal file
136
AllLibs/MyLibs/__mylibs_include.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file mylibs_include.h
|
||||
* @brief Заголочный файл для всех библиотек
|
||||
**************************************************************************
|
||||
* @details
|
||||
Здесь нужно собрать библиотеки и дефайны, которые должны быть видны во всем проекте,
|
||||
чтобы не подключать 100 инклюдов в каждом ".c" файле
|
||||
**************************************************************************
|
||||
* @defgroup MYLIBS_ALL My Libs
|
||||
* @brief Все используемые MyLibs библиотеки
|
||||
* @details
|
||||
Для подключения библиотеки необходимо:
|
||||
- Сконфигурировать mylibs_config.h:
|
||||
- Подключить заголовочный файл HAL библиотеки конкретного МК (напр. stm32f4xx_hal.h)
|
||||
- Подключить другие заголовочные файлы которые общие для всего проекта и должны быть видны
|
||||
- Подключить mylibs_include.h туда, где необходим доступ к библиотекам.
|
||||
|
||||
*************************************************************************/
|
||||
#ifndef __MYLIBS_INCLUDE_H_
|
||||
#define __MYLIBS_INCLUDE_H_
|
||||
|
||||
#include "mylibs_defs.h"
|
||||
|
||||
|
||||
#ifdef ARM_MATH_CM4
|
||||
#include "arm_math.h"
|
||||
#else
|
||||
#include "math.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef INCLUDE_BIT_ACCESS_LIB
|
||||
#include "bit_access.h"
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_TRACKERS_LIB
|
||||
#include "trackers.h"
|
||||
#else
|
||||
#define TrackerTypeDef(num_user_vars) void *
|
||||
#define num_of_usercnts(_user_) 0
|
||||
#define assert_tracecnt(_cntstruct_, _uservarnumb_) 0
|
||||
#define if_assert_usertracker(_cntstruct_, _uservarnumb_) if(0)
|
||||
#define tern_assert_usertracker(_cntstruct_, _uservarnumb_) 0
|
||||
#define TrackerGet_Ok(_cntstruct_) dummy
|
||||
#define TrackerGet_Err(_cntstruct_) dummy
|
||||
#define TrackerGet_Warn(_cntstruct_) dummy
|
||||
#define TrackerGet_User(_cntstruct_, _uservarnumb_) dummy
|
||||
#define TrackerCnt_Ok(_cntstruct_)
|
||||
#define TrackerCnt_Err(_cntstruct_)
|
||||
#define TrackerCnt_Warn(_cntstruct_)
|
||||
#define TrackerCnt_User(_cntstruct_, _uservarnumb_)
|
||||
#define TrackerWrite_User(_cntstruct_, _uservarnumb_, _val_)
|
||||
#define TrackerClear_All(_cntstruct_)
|
||||
#define TrackerClear_Ok(_cntstruct_)
|
||||
#define TrackerClear_Err(_cntstruct_)
|
||||
#define TrackerClear_Warn(_cntstruct_)
|
||||
#define TrackerClear_User(_cntstruct_)
|
||||
#define TrackerClear_UserAll(_cntstruct_)
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_TRACE_LIB
|
||||
#include "trace.h"
|
||||
#else
|
||||
#define my_printf(...)
|
||||
#define log_printf(TAG, fmt, ...)
|
||||
#define TRACE_GPIO_SET(_gpio_,_pin_)
|
||||
#define TRACE_GPIO_RESET(_gpio_,_pin_)
|
||||
#define RTT_FlashPrepare(...)
|
||||
#define RTT_EraseFlash(...) 0
|
||||
#define RTT_SaveToFlash(...) 0
|
||||
#define RTT_ReadFromFlash(...) 0
|
||||
#define HF_CheckRecovered(...) 0
|
||||
#define HF_HandleFault(...)
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_GEN_OPTIMIZER
|
||||
#include "gen_optimizer.h"
|
||||
#else
|
||||
typedef struct {
|
||||
uint16_t n_params;
|
||||
uint16_t n_cand;
|
||||
uint16_t n_best;
|
||||
uint16_t iq_mutation;
|
||||
int32_t loss[0];
|
||||
int32_t candidates[0][0];
|
||||
} GenOptimizer_t;
|
||||
#define GenOptimizer_Init(opt, n_params, n_cand, n_best, iq_mutation, start_params)
|
||||
#define GenOptimizer_Step(opt, params, LossFunc)
|
||||
#define PARAM_SCALE_Q16(x, min_val, max_val) (x)
|
||||
#define PARAM_UNSCALE_Q16(q16_val, min_val, max_val) (q16_val)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef INCLUDE_BENCH_TEST
|
||||
#include "bench_time.h"
|
||||
#else //BENCH_TIME_ENABLE
|
||||
#define BenchTime_Init()
|
||||
#define BenchTime_Start(channel, ticks, tick_period) 0
|
||||
#define BenchTime_End(channel, ticks) 0
|
||||
#define BenchTime_GetMin(channel) 0
|
||||
#define BenchTime_GetMax(channel) 0
|
||||
#define BenchTime_GetAverage(channel) 0
|
||||
#define BenchTime_GetCount(channel) 0
|
||||
#define BenchTime_GetLast(channel) 0
|
||||
#define BenchTime_ResetStats(channel)
|
||||
#endif //BENCH_TIME_ENABLE
|
||||
|
||||
#ifdef INCLUDE_GENERAL_PERIPH_LIBS
|
||||
|
||||
#include "__general_flash.h"
|
||||
#include "general_gpio.h"
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
#include "general_spi.h"
|
||||
#endif
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
#include "general_uart.h"
|
||||
#endif
|
||||
#ifdef HAL_TIM_MODULE_ENABLED
|
||||
#include "general_tim.h"
|
||||
#endif
|
||||
|
||||
#endif //INCLUDE_GENERAL_PERIPH_LIBS
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////---USER SETTINGS---/////////////////////////
|
||||
// user includes
|
||||
|
||||
// user settings
|
||||
/////////////////////////---USER SETTINGS---/////////////////////////
|
||||
|
||||
|
||||
#endif // __MYLIBS_INCLUDE_H_
|
||||
Reference in New Issue
Block a user