#include <stdio.h>
#include <stdint.h>
#pragma pack(push, 1)
typedef struct {
struct {
uint16_t mon:8; // 月
uint16_t year:8; // 以2000年为基准
};
struct {
uint16_t hour:8; // 时
uint16_t day:8; // 天
};
struct {
uint16_t sec:8; // 秒
uint16_t min:8; // 分
};
struct {
uint16_t zone_min:8; // 时区(分)
uint16_t zone_hour:8; // 时区(时)
};
} time_cfg_t;
#pragma pack()
time_cfg_t time_cfg;
int main()
{
ble_cfg.ble_flag.guest_flag = 1;
printf("ble flag: %04x\n", ble_cfg.ble_flag.all);
return 0;
}