Move alarm and time types into dedicated headers
This commit is contained in:
@@ -6,28 +6,7 @@
|
||||
#ifndef TIME_MANAGER_H
|
||||
#define TIME_MANAGER_H
|
||||
|
||||
typedef struct {
|
||||
unsigned hour;
|
||||
unsigned minute;
|
||||
unsigned second;
|
||||
} Time;
|
||||
|
||||
typedef struct {
|
||||
unsigned year;
|
||||
unsigned month;
|
||||
unsigned day;
|
||||
} Date;
|
||||
|
||||
typedef enum {
|
||||
WEEK_DAY_MONDAY,
|
||||
WEEK_DAY_TUESDAY,
|
||||
WEEK_DAY_WEDNESDAY,
|
||||
WEEK_DAY_THURSDAY,
|
||||
WEEK_DAY_FRIDAY,
|
||||
WEEK_DAY_SATURDAY,
|
||||
WEEK_DAY_SUNDAY,
|
||||
WEEK_DAY_COUNT,
|
||||
} WeekDay;
|
||||
#include "time_types.h"
|
||||
|
||||
typedef void (*TimeCallback)(Time now);
|
||||
|
||||
|
||||
32
components/time/time_types.h
Normal file
32
components/time/time_types.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* Copyright (c) Camden Dixie O'Brien
|
||||
*/
|
||||
|
||||
#ifndef TIME_TYPES_H
|
||||
#define TIME_TYPES_H
|
||||
|
||||
typedef struct {
|
||||
unsigned hour;
|
||||
unsigned minute;
|
||||
unsigned second;
|
||||
} Time;
|
||||
|
||||
typedef struct {
|
||||
unsigned year;
|
||||
unsigned month;
|
||||
unsigned day;
|
||||
} Date;
|
||||
|
||||
typedef enum {
|
||||
WEEK_DAY_MONDAY,
|
||||
WEEK_DAY_TUESDAY,
|
||||
WEEK_DAY_WEDNESDAY,
|
||||
WEEK_DAY_THURSDAY,
|
||||
WEEK_DAY_FRIDAY,
|
||||
WEEK_DAY_SATURDAY,
|
||||
WEEK_DAY_SUNDAY,
|
||||
WEEK_DAY_COUNT,
|
||||
} WeekDay;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user