mirror of
https://github.com/esphome/esphome.git
synced 2024-11-12 18:27:46 +01:00
commit
3bae72a8a7
6 changed files with 8 additions and 5 deletions
|
@ -32,7 +32,7 @@ void FT63X6Touchscreen::setup() {
|
|||
if (this->interrupt_pin_ != nullptr) {
|
||||
this->interrupt_pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
|
||||
this->interrupt_pin_->setup();
|
||||
this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_FALLING_EDGE);
|
||||
this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_ANY_EDGE);
|
||||
}
|
||||
|
||||
if (this->reset_pin_ != nullptr) {
|
||||
|
@ -78,13 +78,12 @@ void FT63X6Touchscreen::update_touches() {
|
|||
uint16_t touch_id, x, y;
|
||||
|
||||
uint8_t touches = this->read_touch_number_();
|
||||
ESP_LOGV(TAG, "Touches found: %d", touches);
|
||||
if ((touches == 0x00) || (touches == 0xff)) {
|
||||
// ESP_LOGD(TAG, "No touches detected");
|
||||
return;
|
||||
}
|
||||
|
||||
ESP_LOGV(TAG, "Touches found: %d", touches);
|
||||
|
||||
for (auto point = 0; point < touches; point++) {
|
||||
if (((this->read_touch_event_(point)) & 0x01) == 0) { // checking event flag bit 6 if it is null
|
||||
touch_id = this->read_touch_id_(point); // id1 = 0 or 1
|
||||
|
|
|
@ -729,6 +729,7 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
|
|||
}
|
||||
|
||||
void VoiceAssistant::on_audio(const api::VoiceAssistantAudio &msg) {
|
||||
#ifdef USE_SPEAKER // We should never get to this function if there is no speaker anyway
|
||||
if (this->speaker_buffer_index_ + msg.data.length() < SPEAKER_BUFFER_SIZE) {
|
||||
memcpy(this->speaker_buffer_ + this->speaker_buffer_index_, msg.data.data(), msg.data.length());
|
||||
this->speaker_buffer_index_ += msg.data.length();
|
||||
|
@ -737,6 +738,7 @@ void VoiceAssistant::on_audio(const api::VoiceAssistantAudio &msg) {
|
|||
} else {
|
||||
ESP_LOGE(TAG, "Cannot receive audio, buffer is full");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
VoiceAssistant *global_voice_assistant = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2024.4.0b2"
|
||||
__version__ = "2024.4.0b3"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||
|
|
|
@ -134,7 +134,7 @@ class ProjectUpdateTrigger : public Trigger<std::string>, public Component {
|
|||
uint32_t hash = fnv1_hash(ESPHOME_PROJECT_NAME);
|
||||
ESPPreferenceObject pref = global_preferences->make_preference<char[30]>(hash, true);
|
||||
char previous_version[30];
|
||||
char current_version[30] = ESPHOME_PROJECT_VERSION;
|
||||
char current_version[30] = ESPHOME_PROJECT_VERSION_30;
|
||||
if (pref.load(&previous_version)) {
|
||||
int cmp = strcmp(previous_version, current_version);
|
||||
if (cmp < 0) {
|
||||
|
|
|
@ -394,6 +394,7 @@ async def to_code(config):
|
|||
if project_conf := config.get(CONF_PROJECT):
|
||||
cg.add_define("ESPHOME_PROJECT_NAME", project_conf[CONF_NAME])
|
||||
cg.add_define("ESPHOME_PROJECT_VERSION", project_conf[CONF_VERSION])
|
||||
cg.add_define("ESPHOME_PROJECT_VERSION_30", project_conf[CONF_VERSION][:30])
|
||||
for conf in project_conf.get(CONF_ON_UPDATE, []):
|
||||
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID])
|
||||
await cg.register_component(trigger, conf)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#define ESPHOME_BOARD "dummy_board"
|
||||
#define ESPHOME_PROJECT_NAME "dummy project"
|
||||
#define ESPHOME_PROJECT_VERSION "v2"
|
||||
#define ESPHOME_PROJECT_VERSION_30 "v2"
|
||||
#define ESPHOME_VARIANT "ESP32"
|
||||
|
||||
// Feature flags
|
||||
|
|
Loading…
Reference in a new issue