try to fix submodule

This commit is contained in:
2023-11-09 19:02:15 -05:00
parent c1d45aa443
commit deea94b076
366 changed files with 40228 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
#include "./MagneticSensorAS5048A.h"
#include "common/foc_utils.h"
#include "common/time_utils.h"
MagneticSensorAS5048A::MagneticSensorAS5048A(int nCS, bool fastMode, SPISettings settings) : AS5048A(settings, nCS), fastMode(fastMode) {
}
MagneticSensorAS5048A::~MagneticSensorAS5048A(){
}
void MagneticSensorAS5048A::init(SPIClass* _spi) {
this->AS5048A::init(_spi);
this->Sensor::init();
}
float MagneticSensorAS5048A::getSensorAngle() {
float angle_data = readRawAngle();
if (!fastMode) // read again to ensure current value
angle_data = readRawAngle();
angle_data = ( angle_data / (float)AS5048A_CPR ) * _2PI;
// return the shaft angle
return angle_data;
}