mirror of
https://github.com/okalachev/flix.git
synced 2026-06-27 21:46:38 +00:00
Improve voltage measurement
Apply PWM_VOLT_PIN without reboot. Check if the voltage pin can be used with ADC when setting up. Set voltage to NAN, when it's unknown (including pyflix). pyflix@0.15. Don't send BATTERY_STATUS when voltage is unknown. Add dummy voltage to the simulator.
This commit is contained in:
@@ -168,6 +168,7 @@ void delay(uint32_t ms) {
|
||||
bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution) { return true; }
|
||||
bool ledcWrite(uint8_t pin, uint32_t duty) { return true; }
|
||||
uint32_t ledcChangeFrequency(uint8_t pin, uint32_t freq, uint8_t resolution) { return freq; }
|
||||
int8_t digitalPinToAnalogChannel(uint8_t pin) { return -1; }
|
||||
uint32_t analogReadMilliVolts(uint8_t pin) { return 0; }
|
||||
|
||||
unsigned long __micros;
|
||||
|
||||
@@ -58,6 +58,7 @@ void handleMavlink(const void *_msg);
|
||||
void mavlinkPrint(const char* str);
|
||||
void sendMavlinkPrint();
|
||||
inline Quaternion fluToFrd(const Quaternion &q);
|
||||
void setupPower();
|
||||
void failsafe();
|
||||
void rcLossFailsafe();
|
||||
void descend();
|
||||
|
||||
@@ -73,6 +73,8 @@ public:
|
||||
gyro = Vector(imu->AngularVelocity().X(), imu->AngularVelocity().Y(), imu->AngularVelocity().Z());
|
||||
acc = this->accFilter.update(Vector(imu->LinearAcceleration().X(), imu->LinearAcceleration().Y(), imu->LinearAcceleration().Z()));
|
||||
|
||||
voltage = 4.2f; // dummy voltage value
|
||||
|
||||
readRC();
|
||||
estimate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user