refactor: use standard integer types; remove <algorithm> dependency

- Replaced unsigned char,  int and long long with uint8_t int32_t and int64_t for platform independence
- Removed <algorithm> dependency, implemented custom alternatives
This commit is contained in:
Gatsby
2024-11-07 14:13:37 +08:00
parent d4159ec998
commit 2fc5941f0f
7 changed files with 144 additions and 144 deletions
+7 -7
View File
@@ -450,10 +450,10 @@ typedef struct {
// 定义函数指针类型
typedef void (*CX9261A_LoggingFunc)(const char* msg);
typedef void (*CX9261A_WriteSpiFunc)(int address, int value);
typedef int (*CX9261A_ReadSpiFunc)(int address);
typedef void (*CX9261A_WriteSpiFunc)(uint16_t address, uint8_t value);
typedef int (*CX9261A_ReadSpiFunc)(uint16_t address);
typedef void (*CX9261A_SetPinFunc)(uint32_t pin, bool value);
typedef void (*CX9261A_PauseFunc)(double ms);
typedef void (*CX9261A_SetPinFunc)(int pin, int value);
/**
* @brief 绑定日志函数
@@ -698,14 +698,14 @@ CX9261A_CalibPredis CX9261A_readRxCalibPredis(CX9261A_RxChannel chan);
* @param chan 接收通道
* @param pll 使用的PLL
*/
void CX9261A_saveRxCalibPredis(unsigned char index, CX9261A_RxChannel chan, CX9261A_LoSource pll);
void CX9261A_saveRxCalibPredis(uint8_t index, CX9261A_RxChannel chan, CX9261A_LoSource pll);
/**
* @brief 加载保存的校准值
* @param index 第index组校准值
* @param chan 指定加载校准值的通道
* @param pll 使用的PLL
*/
void CX9261A_loadRxCalibPredis(unsigned char index, CX9261A_RxChannel chan, CX9261A_LoSource pll);
void CX9261A_loadRxCalibPredis(uint8_t index, CX9261A_RxChannel chan, CX9261A_LoSource pll);
/**
* @brief Rx窄带多点校准
* @param config CX9261A配置结构体
@@ -758,14 +758,14 @@ void CX9261A_txCalib(const CX9261A_CX9261AConfiguration *config);
* @param chan 发射通道
* @param pll pll
*/
void CX9261A_saveTxCalibPredis(unsigned char index, CX9261A_TxChannel chan, CX9261A_LoSource pll);
void CX9261A_saveTxCalibPredis(uint8_t index, CX9261A_TxChannel chan, CX9261A_LoSource pll);
/**
* @brief 加载保存的校准值
* @param index 第index组校准值
* @param chan 指定加载校准值的通道
* @param pll 指定加载校准值对应的PLL
*/
void CX9261A_loadTxCalibPredis(unsigned char index, CX9261A_TxChannel chan, CX9261A_LoSource pll);
void CX9261A_loadTxCalibPredis(uint8_t index, CX9261A_TxChannel chan, CX9261A_LoSource pll);
/**
* @brief Qec校准顶层函数,内部根据配置选择使用对应方法进行校准
* @param config CX9261A配置结构体