|
|
@@ -81,6 +81,7 @@ class EspSparkBot : public Ml307Board {
|
|
|
private:
|
|
|
i2c_master_bus_handle_t i2c_bus_;
|
|
|
Button boot_button_;
|
|
|
+ Button asr_button_;
|
|
|
Display* display_;
|
|
|
Backlight* backlight_;
|
|
|
|
|
|
@@ -316,6 +317,10 @@ private:
|
|
|
}
|
|
|
app.ToggleChatState();
|
|
|
});
|
|
|
+ asr_button_.OnClick([this]() {
|
|
|
+ std::string wake_word="你好小智";
|
|
|
+ Application::GetInstance().WakeWordInvoke(wake_word);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 初始化物联网功能
|
|
|
@@ -328,6 +333,7 @@ private:
|
|
|
public:
|
|
|
EspSparkBot() : Ml307Board(ML307_TX_PIN, ML307_RX_PIN, 4096),
|
|
|
boot_button_(BOOT_BUTTON_GPIO),
|
|
|
+ asr_button_(ASR_BUTTON_GPIO),
|
|
|
display_(nullptr),
|
|
|
backlight_(nullptr) {
|
|
|
InitializeI2c();
|