support external compass

This commit is contained in:
matt
2021-02-05 22:57:17 +08:00
parent 6b1b4d753d
commit 85632dce48
+11
View File
@@ -15,6 +15,7 @@
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */ /* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL #ifdef HAL_IMPL
#include "spi_devs.h" #include "spi_devs.h"
#include "i2c_devs.h"
#endif #endif
#include <stdint.h> #include <stdint.h>
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */ /* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
@@ -112,6 +113,16 @@ void hal_3axis_magn_Outputs_wrapper(HAL_magn_mG_t *magn,
if (magn_inited[1]) if (magn_inited[1])
{ {
#ifdef HAL_IMPL #ifdef HAL_IMPL
if (cps_ist8310_ext.success)
{
magn->x = cps_ist8310_ext.field[0];
magn->y = cps_ist8310_ext.field[1];
magn->z = cps_ist8310_ext.field[2];
magn->seq = cps_ist8310_ext.sample_count;
ErrorCode[0] = 0;
}
else
ErrorCode[0] = -1; ErrorCode[0] = -1;
#endif #endif
} }