上位机通讯正常

This commit is contained in:
RB 2025-03-04 17:26:45 +08:00
parent 772c44f3d9
commit b6e1393f4d
4 changed files with 9829 additions and 0 deletions

BIN
MDK-ARM/DevC/DevC.axf Normal file

Binary file not shown.

9765
MDK-ARM/DevC/DevC.hex Normal file

File diff suppressed because it is too large Load Diff

View File

@ -112,3 +112,17 @@ inline float CalculateRpm(float bullet_speed, float fric_radius, bool is17mm) {
/* 不为裁判系统设定值时,计算转速 */
return 60.0f * (float)bullet_speed / (M_2PI * fric_radius);
}
/**
* @brief
*
* @param file
* @param line
*/
void VerifyFailed(const char *file, uint32_t line) {
UNUSED(file);
UNUSED(line);
while (1) {
__NOP();
}
}

View File

@ -104,3 +104,53 @@ float CalculateRpm(float bullet_speed, float fric_radius, bool is17mm);
#ifdef __cplusplus
}
#endif
#ifdef DEBUG
/**
* @brief
*
*/
#define ASSERT(expr) \
do { \
if (!(expr)) { \
VerifyFailed(__FILE__, __LINE__); \
} \
} while (0)
#else
/**
* @brief DEBUG
*
*/
#define ASSERT(expr) ((void)(0))
#endif
#ifdef DEBUG
/**
* @brief
*
*/
#define VERIFY(expr) \
do { \
if (!(expr)) { \
VerifyFailed(__FILE__, __LINE__); \
} \
} while (0)
#else
/**
* @brief
*
*/
#define VERIFY(expr) ((void)(expr))
#endif
/**
* @brief
*
* @param file
* @param line
*/
void VerifyFailed(const char *file, uint32_t line);