串口init测试通过,其他模块待测试

This commit is contained in:
吕全辉
2020-05-17 16:27:56 +08:00
parent 13d20f8700
commit 1415f9cff2
8 changed files with 440 additions and 18 deletions
+60 -2
View File
@@ -16,6 +16,8 @@
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
/* TODO include files */
#include "AppProcessQEkff.h"
#endif
#include <stdint.h>
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
@@ -41,6 +43,27 @@ void initialize_6axis_imu(uint8_t id)
#endif
}
break;
case 1:
if (!imu_inited[1])
{
#ifdef HAL_IMPL
// TODO initialize 6axis-IMU No.1
imu_inited[1] = 1;
#endif
}
break;
case 2:
if (!imu_inited[2])
{
#ifdef HAL_IMPL
// TODO initialize 6axis-IMU No.2
imu_inited[2] = 1;
#endif
}
break;
default:
break;
}
@@ -67,7 +90,7 @@ void hal_6axis_imu_Outputs_wrapper(HAL_acc_SI_t *acc,
const uint8_T *id, const int_T p_width0)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
ErrorCode[0] = -1;
ErrorCode[0] = -1;
switch (id[0])
{
case 0:
@@ -75,7 +98,42 @@ ErrorCode[0] = -1;
{
#ifdef HAL_IMPL
// TODO read 6axis-IMU
ErrorCode[0] = 0;
if(AppImuGetRawData(id[0], acc->x, acc->y, acc->z, gyro->x, gyro->y, gyro->z))
{
ErrorCode[0] = 0;
}
else
ErrorCode[0] = -1;
#endif
}
break;
case 1:
if (imu_inited[1])
{
#ifdef HAL_IMPL
// TODO read 6axis-IMU
if(AppImuGetRawData(id[0], acc->x, acc->y, acc->z, gyro->x, gyro->y, gyro->z))
{
ErrorCode[0] = 0;
}
else
ErrorCode[0] = -1;
#endif
}
break;
case 2:
if (imu_inited[2])
{
#ifdef HAL_IMPL
// TODO read 6axis-IMU
if(AppImuGetRawData(id[0], acc->x, acc->y, acc->z, gyro->x, gyro->y, gyro->z))
{
ErrorCode[0] = 0;
}
else
ErrorCode[0] = -1;
#endif
}
break;