mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Make fast update intervals in qmc5883l work (#6647)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
1b9a30e921
commit
bc65e6e914
2 changed files with 6 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
#include "qmc5883l.h"
|
#include "qmc5883l.h"
|
||||||
|
#include "esphome/core/application.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
#include "esphome/core/hal.h"
|
#include "esphome/core/hal.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -59,6 +60,10 @@ void QMC5883LComponent::setup() {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->get_update_interval() < App.get_loop_interval()) {
|
||||||
|
high_freq_.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void QMC5883LComponent::dump_config() {
|
void QMC5883LComponent::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "QMC5883L:");
|
ESP_LOGCONFIG(TAG, "QMC5883L:");
|
||||||
|
|
|
@ -56,6 +56,7 @@ class QMC5883LComponent : public PollingComponent, public i2c::I2CDevice {
|
||||||
COMMUNICATION_FAILED,
|
COMMUNICATION_FAILED,
|
||||||
} error_code_;
|
} error_code_;
|
||||||
bool read_byte_16_(uint8_t a_register, uint16_t *data);
|
bool read_byte_16_(uint8_t a_register, uint16_t *data);
|
||||||
|
HighFrequencyLoopRequester high_freq_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace qmc5883l
|
} // namespace qmc5883l
|
||||||
|
|
Loading…
Reference in a new issue