48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
/***
|
|
* @Author: shenghao.xu
|
|
* @Date: 2023-04-04 08:13:11
|
|
* @LastEditors: shenghao.xu
|
|
* @LastEditTime: 2023-04-04 10:13:21
|
|
* @Description:
|
|
* @email:545403892@qq.com
|
|
* @Copyright (c) 2023 by shenghao.xu, All Rights Reserved.
|
|
*/
|
|
|
|
#ifndef __LIB_H
|
|
#define __LIB_H
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "data_type_def.h"
|
|
#include "malloc.h"
|
|
#include "osel_arch.h"
|
|
#include "data_analysis.h"
|
|
#include "pbuf.h"
|
|
#include "debug.h"
|
|
#include "cmd.h"
|
|
|
|
#ifndef STM32
|
|
#include "log.h"
|
|
#else
|
|
#define LOG_PRINT(fmt, ...) \
|
|
do \
|
|
{ \
|
|
} while (0);
|
|
#define LOG_ERR(fmt, ...) \
|
|
do \
|
|
{ \
|
|
} while (0);
|
|
#define LOG_HEX(data, len) \
|
|
do \
|
|
{ \
|
|
} while (0);
|
|
#endif
|
|
|
|
|
|
|
|
void version_split(uint8_t *version, uint8_t *hi, uint8_t *lo);
|
|
bool is_in_array(uint16_t *arr, uint16_t len, uint16_t val);
|
|
uint16_t crc16_compute(const uint8_t *const uc_ptr, uint16_t uc_len);
|
|
uint8_t xor_compute(const uint8_t *const uc_ptr, uint16_t uc_len);
|
|
uint8_t get_bit_num(uint8_t bit);
|
|
#endif //__LIB_H
|