更新文档
This commit is contained in:
+6
-14
@@ -23,15 +23,6 @@ static int8_t cached_time_slots[MAX_CACHED_IDS];
|
||||
static uint8_t cached_id_count = 0;
|
||||
static int8_t active_cache_slot = -1;
|
||||
|
||||
// 默认时间段配置(在服务器配置下载失败时使用)
|
||||
static const TimeSlot default_time_slots[] = {
|
||||
{1, 8, 0, 9, 30, "Morning Check-in"}, // 上午签到 08:00-09:30
|
||||
{1, 12, 0, 13, 0, "Noon Check-out"}, // 中午签退 12:00-13:00
|
||||
{1, 14, 0, 15, 0, "Afternoon Check-in"}, // 下午签到 14:00-15:00
|
||||
{1, 17, 0, 18, 30, "Evening Check-out"}, // 晚上签退 17:00-18:30
|
||||
};
|
||||
#define DEFAULT_TIME_SLOT_COUNT 4
|
||||
|
||||
// 当前时间(由外部更新,如果有RTC则从RTC读取)
|
||||
static uint8_t current_hour = 8;
|
||||
static uint8_t current_minute = 30;
|
||||
@@ -74,9 +65,9 @@ void Attendance_Init(void)
|
||||
current_minute = 0;
|
||||
memset(attendance_records, 0, sizeof(attendance_records));
|
||||
|
||||
// 初始化为默认时间段配置
|
||||
memcpy(time_slots, default_time_slots, sizeof(default_time_slots));
|
||||
time_slot_count = DEFAULT_TIME_SLOT_COUNT;
|
||||
// 启动时不预置考勤时段,等待服务端或上位机下发配置。
|
||||
memset(time_slots, 0, sizeof(time_slots));
|
||||
time_slot_count = 0;
|
||||
|
||||
// 清空缓存
|
||||
cached_id_count = 0;
|
||||
@@ -283,8 +274,9 @@ uint8_t Attendance_ParseTimeSlotsJSON(const char* json_str)
|
||||
|
||||
while (*ptr == ' ' || *ptr == '\n' || *ptr == '\r' || *ptr == '\t') ptr++;
|
||||
if (*ptr == ']') {
|
||||
DEBUG_INFO("[Attendance] Empty time slot config, keeping current slots");
|
||||
return time_slot_count;
|
||||
Attendance_UpdateTimeSlots(temp_slots, 0);
|
||||
DEBUG_INFO("[Attendance] Empty time slot config applied");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 解析每个时间段对象
|
||||
|
||||
Reference in New Issue
Block a user