Skip to content

Commit

Permalink
Merge pull request #45 from CodyTolene/ct/update-uart
Browse files Browse the repository at this point in the history
UART Flipper Firmware v0.98-rc+
  • Loading branch information
CodyTolene authored Mar 12, 2024
2 parents 5f1caf7 + 467755f commit fd8665c
Show file tree
Hide file tree
Showing 38 changed files with 403 additions and 576 deletions.
18 changes: 18 additions & 0 deletions .github/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Run ufbt lint in the "fap" folder
fap_folder="fap"

# Change to the root directory of the repository
cd "$(git rev-parse --show-toplevel)"

# Run ufbt lint in the "fap" folder
if ! (cd "$fap_folder" && ufbt lint); then
echo "Error: ufbt lint failed in the 'fap' folder. Please fix the issues before committing."
exit 1
else
echo "ufbt lint passed in the 'fap' folder."
fi

# If everything is okay, exit with a zero status
exit 0
Binary file added .github/images/video_rechtsanwalt_okan_dogan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Dev - Build & Upload FAP"
on:
push:
branches:
- dev
jobs:
ufbt-build-action:
runs-on: ubuntu-latest
name: "Build: Dev"
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: recursive

# Flipper Zero ufbt action
# https://github.com/flipperdevices/flipperzero-ufbt-action
- name: "Build"
uses: flipperdevices/flipperzero-ufbt-action@v0.1
id: build-app
with:
app-dir: ./fap
sdk-channel: dev

- name: "Create FAP Download (dev)"
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-dev-${{ steps.build-app.outputs.suffix }}.zip
path: ${{ steps.build-app.outputs.fap-artifacts }}
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: "Build + upload."
name: "Release - Build & Upload FAP"
on:
push:
branches:
# Run on push to main.
- main

schedule:
# Run every day at 00:00 UTC (midnight)
# Run every day at 00:00 UTC (midnight) to build the latest release
# for new and upcoming firmware.
- cron: "0 0 * * *"

jobs:
ufbt-build-action:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# - name: dev
# sdk-channel: dev
- name: "dev"
sdk-channel: dev

- name: release
sdk-channel: release
- name: "rc"
sdk-channel: rc

# - name: rc
# sdk-channel: rc
- name: "release"
sdk-channel: release

name: "ufbt: Build for ${{ matrix.name }}"
name: "Build: ${{ matrix.name }}"
steps:
- name: Checkout
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: recursive

- name: Build with ufbt
uses: flipperdevices/flipperzero-ufbt-action@v0.1.3
# Flipper Zero ufbt action
# https://github.com/flipperdevices/flipperzero-ufbt-action
- name: "Build"
uses: flipperdevices/flipperzero-ufbt-action@v0.1
id: build-app
with:
app-dir: ./fap
sdk-channel: ${{ matrix.sdk-channel }}

- name: Upload app artifacts
- name: "Create FAP Downloads (dev/release/rc)"
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-${{ matrix.name }}-${{ steps.build-app.outputs.suffix }}.zip
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/lint-pull-request.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/pull-request-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Dev PR - Lint & Build Test"
on:
pull_request:
branches:
- dev
jobs:
ufbt-test-build-action:
runs-on: ubuntu-latest
name: "PR Build: dev"
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: recursive

# Flipper Zero ufbt action
# https://github.com/flipperdevices/flipperzero-ufbt-action
- name: "Build"
uses: flipperdevices/flipperzero-ufbt-action@v0.1
id: build-app
with:
app-dir: ./fap
sdk-channel: dev

- name: "Lint"
uses: flipperdevices/flipperzero-ufbt-action@v0.1
with:
app-dir: ./fap
skip-setup: true
task: lint
43 changes: 43 additions & 0 deletions .github/workflows/pull-request-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Release PR - Lint & Build Test"
on:
pull_request:
branches:
- main
jobs:
ufbt-test-build-action:
runs-on: ubuntu-latest
# The following builds must pass before release is accepted:
strategy:
matrix:
include:
- name: "dev"
sdk-channel: dev

- name: "rc"
sdk-channel: rc

- name: "release"
sdk-channel: release

name: "PR Build: ${{ matrix.name }}"
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: recursive

# Flipper Zero ufbt action
# https://github.com/flipperdevices/flipperzero-ufbt-action
- name: "Build"
uses: flipperdevices/flipperzero-ufbt-action@v0.1
id: build-app
with:
app-dir: ./fap
sdk-channel: ${{ matrix.sdk-channel }}

- name: "Lint"
uses: flipperdevices/flipperzero-ufbt-action@v0.1
with:
app-dir: ./fap
skip-setup: true
task: lint
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
## Table of Contents <a name="index"></a>

- [Introduction](#intro)
- [YouTube](#youtube)
- [Videos](#videos)
- [Hardware Requirements](#hardware-requirements)
- [Hardware Installation](#hardware-installation)
- [Firmware Installation](#firmware-installation)
Expand Down Expand Up @@ -46,9 +46,11 @@ There will be many more features added in the future! If you have any ideas or s

<p align="right">[ <a href="#index">Back to top</a> ]</p>

## YouTube <a name="youtube"></a>
## Videos <a name="videos"></a>

This section is dedicated to all the fans that have made videos of this project! Thank you! If you have a video you'd like to share, please let me know by opening an issue [here][issues-link].
This section is dedicated to all the fans that have made videos of this project! Thank you!

If you have a video you'd like to share, please let me know by opening an issue [here][issues-link].

<details>

Expand All @@ -58,8 +60,16 @@ This section is dedicated to all the fans that have made videos of this project!

**Flipper Zero ESP32 CAM Camera Module** - by TAKEAPART

[https://www.youtube.com/watch?v=cEl5UnWH_Ok](https://www.youtube.com/watch?v=cEl5UnWH_Ok)

[![Flipper Zero ESP32 CAM Camera Module - TAKEAPART](https://img.youtube.com/vi/cEl5UnWH_Ok/0.jpg)](https://www.youtube.com/watch?v=cEl5UnWH_Ok)

**Tech With Kids - Flipper Zero ESP32 Kamera** - by @rechtsanwalt.okan.dogan

[https://www.instagram.com/reel/C4DrufKoKrb/](https://www.instagram.com/reel/C4DrufKoKrb/)

[![Flipper Zero ESP32 CAM Camera Module - @rechtsanwalt.okan.dogan](.github/images/video_rechtsanwalt_okan_dogan.png)](https://www.instagram.com/reel/C4DrufKoKrb/)

</details>

<p align="right">[ <a href="#index">Back to top</a> ]</p>
Expand Down Expand Up @@ -228,6 +238,8 @@ A huge thanks to the following people and projects for making this possible:

- This project is based on & forked from the [Flipper Zero Camera Application][flipperzero-camera] by [Z4urce][github-profile-z4urce]. Thanks Z4urce for the inspiration and the great work!
- I based this projects application structure on the [Flipper Zero Boilerplate Application][flipper-zero-fap-boilerplate] by [leedave][github-profile-leedave]. Thanks leedave for the great boilerplate application that helped me learn how to structure a Flipper Zero application properly!
- [WillyJL][github-profile-willyjl] for your guidance and wisdom.
- [TalkingSasquach][github-profile-talkingsasquach] for all of your helpful [YouTube videos][youtube-talkingsasquach] and [Discord community][discord-squachtopia].
- The project images were drawn using the a application called "[lopaka][lopaka]" by [sbrin][github-profile-sbrin]. Thanks sbrin for your help in creating the images for this project!
- The Flipper Zero community for all your support and feedback!

Expand All @@ -243,14 +255,14 @@ To contribute to this project, please follow the steps below:
4. Request PR [here][pull-request-link], introduce work via your branch.
5. Wait for review and merge.

When developing the firmware, be sure to download the dependencies by running the `firmware-flash.bat` batch script at the root of this directory. This will download the ESP32-CAM firmware dependencies to the directories defined in the `arduino-cli.yaml` file post-run. Add these dependencies and their directories to your "Include path" in your IDE of choice. I prefer Visual Studio Code, there's a guide on how to get started with that workflow here:
When developing the firmware, be sure to download the dependencies by running the `firmware-assets.bat` batch script at the root of this directory. This will download the ESP32-CAM firmware dependencies (Arduino Build & Git Assets) to your Windows TEMP folder. You can run the same script over again later to remove the temporary files when you're done using them. Once installed, add these dependencies and their directories to your "Include path" in your IDE of choice. I prefer Visual Studio Code; there's a guide on how to get started with that workflow here:

https://github.com/CodyTolene/Flipper-Zero-Development-Toolkit

Example include path:

```markdown
C:/Users/<username>/AppData/Local/Temp/arduino-cli/**
C:/Users/<username>/AppData/Local/Temp/arduino-cli/**/**
```

Thank you for any and all contributions to this project, I'm looking forward to seeing what you come up with! If you have any questions, please let me know by opening an issue [here][issues-link].
Expand Down Expand Up @@ -283,13 +295,17 @@ Cody Tolene

[arduino-ide]: https://www.arduino.cc/en/software
[btc-address-link]: https://explorer.btc.com/btc/address/bc1qfx3lvspkj0q077u3gnrnxqkqwyvcku2nml86wmudy7yf2u8edmqq0a5vnt
[discord-squachtopia]: https://discord.gg/squachtopia
[flipper-zero-apps]: https://docs.flipper.net/apps
[flipper-zero-fap-boilerplate]: https://github.com/leedave/flipper-zero-fap-boilerplate
[flipperzero-camera]: https://github.com/Z4urce/flipperzero-camera
[github-actions-link]: https://github.com/CodyTolene/Flipper-Zero-Camera-Suite/actions?query=workflow%3A%22Build+%2B+upload.%22
[github-profile-leedave]: https://github.com/leedave
[github-profile-sbrin]: https://github.com/sbrin
[github-profile-talkingsasquach]: https://github.com/skizzophrenic
[github-profile-willyjl]: https://github.com/Willy-JL
[github-profile-z4urce]: https://github.com/Z4urce
[issues-link]: https://github.com/CodyTolene/Flipper-Zero-Camera-Suite/issues
[lopaka]: https://github.com/sbrin/lopaka
[pull-request-link]: https://github.com/CodyTolene/Flipper-Zero-Camera-Suite/pulls
[youtube-talkingsasquach]: https://www.youtube.com/@TalkingSasquach
1 change: 0 additions & 1 deletion fap/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ App(
fap_category="GPIO",
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.6",
fap_weburl="https://github.com/CodyTolene/Flipper-Zero-Cam",
name="[ESP32] Camera Suite",
Expand Down
Empty file added fap/assets/.gitkeep
Empty file.
19 changes: 11 additions & 8 deletions fap/camera_suite.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "camera_suite.h"
#include <stdlib.h>
#include <expansion/expansion.h>

bool camera_suite_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
Expand Down Expand Up @@ -71,12 +72,6 @@ CameraSuite* camera_suite_app_alloc() {
CameraSuiteViewIdCamera,
camera_suite_view_camera_get_view(app->camera_suite_view_camera));

app->camera_suite_view_wifi_camera = camera_suite_view_wifi_camera_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
CameraSuiteViewIdWiFiCamera,
camera_suite_view_wifi_camera_get_view(app->camera_suite_view_wifi_camera));

app->camera_suite_view_guide = camera_suite_view_guide_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
Expand Down Expand Up @@ -110,7 +105,6 @@ void camera_suite_app_free(CameraSuite* app) {
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdStartscreen);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdMenu);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdCamera);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdWiFiCamera);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdGuide);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdAppSettings);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdCamSettings);
Expand All @@ -122,7 +116,6 @@ void camera_suite_app_free(CameraSuite* app) {
// Free remaining resources
camera_suite_view_start_free(app->camera_suite_view_start);
camera_suite_view_camera_free(app->camera_suite_view_camera);
camera_suite_view_wifi_camera_free(app->camera_suite_view_wifi_camera);
camera_suite_view_guide_free(app->camera_suite_view_guide);

button_menu_free(app->button_menu);
Expand All @@ -138,6 +131,11 @@ void camera_suite_app_free(CameraSuite* app) {
/** Main entry point for initialization. */
int32_t camera_suite_app(void* p) {
UNUSED(p);

// Disable expansion protocol to avoid interference with UART Handle
Expansion* expansion = furi_record_open(RECORD_EXPANSION);
expansion_disable(expansion);

CameraSuite* app = camera_suite_app_alloc();
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
// Init with start scene.
Expand All @@ -147,5 +145,10 @@ int32_t camera_suite_app(void* p) {
camera_suite_save_settings(app);
furi_hal_power_suppress_charge_exit();
camera_suite_app_free(app);

// Return previous state of expansion
expansion_enable(expansion);
furi_record_close(RECORD_EXPANSION);

return 0;
}
3 changes: 0 additions & 3 deletions fap/camera_suite.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "views/camera_suite_view_guide.h"
#include "views/camera_suite_view_start.h"
#include "views/camera_suite_view_camera.h"
#include "views/camera_suite_view_wifi_camera.h"
#include "helpers/camera_suite_storage.h"

#define TAG "Camera Suite"
Expand All @@ -30,7 +29,6 @@ typedef struct {
VariableItemList* variable_item_list;
CameraSuiteViewStart* camera_suite_view_start;
CameraSuiteViewCamera* camera_suite_view_camera;
CameraSuiteViewWiFiCamera* camera_suite_view_wifi_camera;
CameraSuiteViewGuide* camera_suite_view_guide;
uint32_t orientation;
uint32_t dither;
Expand All @@ -46,7 +44,6 @@ typedef enum {
CameraSuiteViewIdStartscreen,
CameraSuiteViewIdMenu,
CameraSuiteViewIdCamera,
CameraSuiteViewIdWiFiCamera,
CameraSuiteViewIdGuide,
CameraSuiteViewIdAppSettings,
CameraSuiteViewIdCamSettings,
Expand Down
5 changes: 5 additions & 0 deletions fap/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
- Full screen 90 degree and 270 degree fill (#6).
- WiFi streaming/connection support (#35).

## v1.7

- Add support for new Flipper Zero Firmware UART updates.
- Remove staged WiFi streaming/connection support for now. Until I can fully test.

## v1.6

- Add new splash/start screen.
Expand Down
Loading

0 comments on commit fd8665c

Please sign in to comment.