support external compass
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
|
||||
#ifdef HAL_IMPL
|
||||
#include "spi_devs.h"
|
||||
#include "i2c_devs.h"
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
|
||||
@@ -112,7 +113,17 @@ void hal_3axis_magn_Outputs_wrapper(HAL_magn_mG_t *magn,
|
||||
if (magn_inited[1])
|
||||
{
|
||||
#ifdef HAL_IMPL
|
||||
ErrorCode[0] = -1;
|
||||
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;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user