Skip to content

Commit 55738ee

Browse files
authored
Merge pull request #52 from CodyTolene/ct/use-new-date-time-type
[FAP] Use new F0 DateTime type.
2 parents e6902fa + fb6b49f commit 55738ee

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

fap/views/camera_suite_view_camera.c

+14-27
Original file line numberDiff line numberDiff line change
@@ -179,33 +179,20 @@ static void save_image_to_flipper_sd_card(void* model) {
179179
FuriString* file_name = furi_string_alloc();
180180

181181
// Get the current date and time.
182-
183-
// Not supported in "Release" F0 build.
184-
// TODO: Remove when DateTime is supported in "Release" F0 build.
185-
// FuriHalRtcDateTime datetime = {0};
186-
187-
// Only supported in "RC" & "Dev" builds.
188-
// TODO: Uncomment when DateTime is supported in "Release" F0 build.
189-
// DateTime datetime = {0};
190-
191-
// TODO: Uncomment when DateTime is supported in "Release" F0 build.
192-
// furi_hal_rtc_get_datetime(&datetime);
193-
194-
// Create the file name using DateTime.
195-
// TODO: Uncomment when DateTime is supported in "Release" F0 build.
196-
// furi_string_printf(
197-
// file_name,
198-
// EXT_PATH("DCIM/%.4d%.2d%.2d-%.2d%.2d%.2d.bmp"),
199-
// datetime.year,
200-
// datetime.month,
201-
// datetime.day,
202-
// datetime.hour,
203-
// datetime.minute,
204-
// datetime.second);
205-
206-
// Just use a random number for now instead of DateTime.
207-
int random_number = rand();
208-
furi_string_printf(file_name, EXT_PATH("DCIM/%d.bmp"), random_number);
182+
DateTime datetime = {0};
183+
184+
furi_hal_rtc_get_datetime(&datetime);
185+
186+
// Create the file name.
187+
furi_string_printf(
188+
file_name,
189+
EXT_PATH("DCIM/%.4d%.2d%.2d-%.2d%.2d%.2d.bmp"),
190+
datetime.year,
191+
datetime.month,
192+
datetime.day,
193+
datetime.hour,
194+
datetime.minute,
195+
datetime.second);
209196

210197
// Open the file for writing. If the file does not exist (it shouldn't),
211198
// create it.

0 commit comments

Comments
 (0)