Baji_Rtc_Toy_Key/main/dzbj/device_mode.h
Rdzleo dbdd304905 代码初始化:
本项目为触摸版项目代码复制而来,基于此版本进行按键功能的适配!
2026-03-23 11:14:56 +08:00

39 lines
754 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief 设备运行模式枚举
*/
typedef enum {
DEVICE_MODE_AI = 0, // AI对话模式WiFi + RTC
DEVICE_MODE_BADGE = 1, // 电子吧唧模式BLE + 图片)
} device_mode_t;
/**
* @brief 从 NVS 读取当前设备模式
* @return 当前模式,默认 DEVICE_MODE_AI
*/
device_mode_t device_mode_get(void);
/**
* @brief 设置设备模式并重启
* @param mode 目标模式
* 写入 NVS 后延迟 500ms 调用 esp_restart()
*/
void device_mode_set(device_mode_t mode);
/**
* @brief 快捷判断是否为电子吧唧模式
* @return true 吧唧模式, false AI模式
*/
bool device_mode_is_badge(void);
#ifdef __cplusplus
}
#endif