Skip to content

Commit

Permalink
Merge pull request #52 from CodyTolene/ct/use-new-date-time-type
Browse files Browse the repository at this point in the history
[FAP] Use new F0 DateTime type.
  • Loading branch information
CodyTolene authored Mar 21, 2024
2 parents e6902fa + fb6b49f commit 55738ee
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions fap/views/camera_suite_view_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,33 +179,20 @@ static void save_image_to_flipper_sd_card(void* model) {
FuriString* file_name = furi_string_alloc();

// Get the current date and time.

// Not supported in "Release" F0 build.
// TODO: Remove when DateTime is supported in "Release" F0 build.
// FuriHalRtcDateTime datetime = {0};

// Only supported in "RC" & "Dev" builds.
// TODO: Uncomment when DateTime is supported in "Release" F0 build.
// DateTime datetime = {0};

// TODO: Uncomment when DateTime is supported in "Release" F0 build.
// furi_hal_rtc_get_datetime(&datetime);

// Create the file name using DateTime.
// TODO: Uncomment when DateTime is supported in "Release" F0 build.
// furi_string_printf(
// file_name,
// EXT_PATH("DCIM/%.4d%.2d%.2d-%.2d%.2d%.2d.bmp"),
// datetime.year,
// datetime.month,
// datetime.day,
// datetime.hour,
// datetime.minute,
// datetime.second);

// Just use a random number for now instead of DateTime.
int random_number = rand();
furi_string_printf(file_name, EXT_PATH("DCIM/%d.bmp"), random_number);
DateTime datetime = {0};

furi_hal_rtc_get_datetime(&datetime);

// Create the file name.
furi_string_printf(
file_name,
EXT_PATH("DCIM/%.4d%.2d%.2d-%.2d%.2d%.2d.bmp"),
datetime.year,
datetime.month,
datetime.day,
datetime.hour,
datetime.minute,
datetime.second);

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

0 comments on commit 55738ee

Please sign in to comment.