From 81f5c6aaa0b28f696b4f18a9f92dd59cf2a7fa36 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Mon, 15 May 2023 16:42:55 +0100 Subject: [PATCH] Create time module stub --- components/time/CMakeLists.txt | 5 +++++ components/time/time.c | 15 +++++++++++++++ components/time/time.h | 24 ++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 components/time/CMakeLists.txt create mode 100644 components/time/time.c create mode 100644 components/time/time.h diff --git a/components/time/CMakeLists.txt b/components/time/CMakeLists.txt new file mode 100644 index 0000000..956f92b --- /dev/null +++ b/components/time/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register( + SRCS "time.c" + INCLUDE_DIRS "." + REQUIRES +) diff --git a/components/time/time.c b/components/time/time.c new file mode 100644 index 0000000..d514eaf --- /dev/null +++ b/components/time/time.c @@ -0,0 +1,15 @@ +/* + * SPDX-License-Identifier: AGPL-3.0-only + * Copyright (c) Camden Dixie O'Brien + */ + +#include "time.h" + +void time_init(void) +{ +} + +Time time_get(void) +{ + return (Time){ .hour = 13, .minute = 37 }; +} diff --git a/components/time/time.h b/components/time/time.h new file mode 100644 index 0000000..843d9c1 --- /dev/null +++ b/components/time/time.h @@ -0,0 +1,24 @@ +/* + * SPDX-License-Identifier: AGPL-3.0-only + * Copyright (c) Camden Dixie O'Brien + */ + +#ifndef TIME_H +#define TIME_H + +typedef struct { + unsigned hour; + unsigned minute; +} Time; + +/** + * Initialize the time module. + */ +void time_init(void); + +/** + * Get the current time. + */ +Time time_get(void); + +#endif