diff --git a/fap/application.fam b/fap/application.fam index 6082d75..07a607e 100644 --- a/fap/application.fam +++ b/fap/application.fam @@ -8,7 +8,7 @@ App( fap_description="A camera suite application for the Flipper Zero ESP32-CAM module.", fap_icon="icons/camera_suite.png", fap_libs=["assets"], - fap_version="1.7", + fap_version="1.8", fap_weburl="https://github.com/CodyTolene/Flipper-Zero-Cam", name="[ESP32] Camera Suite", order=1, diff --git a/fap/docs/CHANGELOG.md b/fap/docs/CHANGELOG.md index 2638599..419852d 100644 --- a/fap/docs/CHANGELOG.md +++ b/fap/docs/CHANGELOG.md @@ -5,6 +5,12 @@ - Full screen 90 degree and 270 degree fill (#6). - WiFi streaming/connection support (#35). +## v1.8 + +- Use new Flipper Zero "DateTime" type for image filenames as "YYYYMMDD-HHMMSS.bmp" (#52). +- Fix pinout guide image in-app for "GND-GND" pin reference (#59). Thanks PyroJoe313! +- Fix up horizontal flip when camera is rotated 180 degrees (#57). Thanks 4k3or3et! + ## v1.7 - Add support for new Flipper Zero Firmware UART updates. @@ -31,7 +37,7 @@ - Improve Firmware code (requires reflash). - Improve Firmware flashing utility code. - Improve GitHub actions code. -- Look to mitigate issue "Mirrored Image" #27. +- Look to mitigate issue "Mirrored Image" (#27). - Addressed new linting issue with "ufbt" tools. ## v1.3 @@ -42,11 +48,12 @@ - Bug Fix: Addressed picture inversion issue reported by user leedave. Thanks for your contribution! (Closes #23) - Code Refinement: Enhanced firmware code for readability and maintainability. Separated concerns into individual files for a more organized structure. - Technical Improvements: Implemented general code enhancements and introduced syntactic sugar for cleaner, more efficient code. -- Work in Progress: Added a new test function for saving pictures to the onboard ESP32-CAM SD card. This feature is under development and will allow users to save pictures directly to the SD card in the future. Tracked under feature request #24. +- Work in Progress: Added a new test function for saving pictures to the onboard ESP32-CAM SD card (#24). ## v1.2 -- Save image support. When the center button is pressed take a picture and save it to the "DCIM" folder at the root of your SD card. The image will be saved as a bitmap file with a timestamp as the filename ("YYYYMMDD-HHMMSS.bmp"). +- Save image support. When the center button is pressed take a picture and save it to the "DCIM" folder at the root of your SD card. +- Image will be saved as a bitmap file with a timestamp as the filename ("YYYYMMDD-HHMMSS.bmp"). - Camera flash support. Flashes the ESP32-CAM onboard LED when a picture is taken if enabled in the settings. - Move the camera dithering type to the settings scene as a new configurable option. - Add "Flash" option to the settings scene as a new configurable option. diff --git a/fap/views/camera_suite_view_camera.c b/fap/views/camera_suite_view_camera.c index e01f6cd..0b88c37 100644 --- a/fap/views/camera_suite_view_camera.c +++ b/fap/views/camera_suite_view_camera.c @@ -26,7 +26,7 @@ static void draw_pixel_by_orientation(Canvas* canvas, uint8_t x, uint8_t y, uint break; } case 2: { // Camera rotated 180 degrees (upside down) - canvas_draw_dot(canvas, FRAME_WIDTH - 1 - x, FRAME_HEIGHT - 1 - y); + canvas_draw_dot(canvas, x, FRAME_HEIGHT - 1 - y); break; } case 3: { // Camera rotated 270 degrees @@ -64,10 +64,11 @@ static void camera_suite_view_camera_draw(Canvas* canvas, void* model) { // Clear the screen. canvas_clear(canvas); - // Draw the ESP32-CAM module. + // Set the font to the secondary font. canvas_set_font(canvas, FontSecondary); + + // Draw the ESP32-CAM module. canvas_draw_str(canvas, 47, 50, "ESP32"); - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 52, 58, "CAM"); canvas_draw_dot(canvas, 84, 3); canvas_draw_box(canvas, 50, 35, 23, 7); @@ -114,7 +115,7 @@ static void camera_suite_view_camera_draw(Canvas* canvas, void* model) { canvas_draw_frame(canvas, 78, 40, 5, 5); // Draw the pinout lines. - canvas_draw_line(canvas, 39, 8, 21, 8); + canvas_draw_line(canvas, 39, 12, 21, 12); canvas_draw_line(canvas, 87, 24, 83, 24); canvas_draw_line(canvas, 87, 32, 83, 32); canvas_draw_line(canvas, 88, 23, 88, 13); @@ -124,27 +125,18 @@ static void camera_suite_view_camera_draw(Canvas* canvas, void* model) { canvas_draw_line(canvas, 126, 44, 89, 44); // Draw the pinout labels. - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 91, 11, "VCC-3V"); - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 91, 27, "U0R-TX"); - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 91, 43, "U0T-RX"); - canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas, 2, 12, "GND"); - canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas, 12, 21, "-GND"); + canvas_draw_str(canvas, 2, 16, "GND"); + canvas_draw_str(canvas, 12, 25, "-GND"); // Draw the "Please Connect Module!" text. - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 2, 40, "Please"); - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 2, 49, "Connect"); - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 2, 58, "Module!"); // Draw the "Back" text and button logo. - canvas_set_font(canvas, FontSecondary); canvas_draw_str(canvas, 92, 57, "Back"); canvas_draw_line(canvas, 116, 49, 116, 53); canvas_draw_line(canvas, 115, 50, 115, 52); @@ -179,33 +171,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.