#endif
- }
+static bool g_enable_uart_rx = true;
+/**
+ * return uart enable flag
+ * true 代表 接收缓存
+ * false 代表 不接收缓存
+*/
+bool uapi_custom_uart_rx_enable_flag(void)
+{
+ return g_enable_uart_rx;
+}
+
+
+/**
+ * 设置 uart rx enable flag
+*/
+void uapi_custom_set_uart_rx_enable_flag(bool enable_uart)
+{
+ g_enable_uart_rx = enable_uart;
++}
+ #define SLEEP_FLAG_PATH "/user/userdata/sleep_flag.bin"
+
+ void uapi_save_sleep_flag(uint8_t *data,uint16_t len)
+ {
+ if(access(SLEEP_FLAG_PATH, F_OK) == -1)
+ uapi_save_file_data(SLEEP_FLAG_PATH,data,len,"wb");
+ else
+ uapi_save_file_data(SLEEP_FLAG_PATH,data,len,"ab");
+ }
+
+ void uapi_clean_sleep_flag(void)
+ {
+ uapi_delete_files(SLEEP_FLAG_PATH);
+ }