Skip to content

Commit

Permalink
Save image names with random numbers intead of DateTime for now (not …
Browse files Browse the repository at this point in the history
…yet supported in release F0 branch).
  • Loading branch information
CodyTolene committed Mar 12, 2024
1 parent a359318 commit f1c0261
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions fap/views/camera_suite_view_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,33 @@ static void save_image_to_flipper_sd_card(void* model) {
FuriString* file_name = furi_string_alloc();

// Get the current date and time.
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);

// 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);

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

0 comments on commit f1c0261

Please sign in to comment.