Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Aug 5, 2023
2 parents b579bca + 20a6aa0 commit 4b8c017
Show file tree
Hide file tree
Showing 182 changed files with 2,497 additions and 6,539 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* @xMasterX

# Assets
/assets/resources/infrared/ @xMasterX @amec0e
/assets/resources/infrared/assets/ @amec0e @Leptopt1los @xMasterX
27 changes: 21 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
## New changes
* Plugins: **22+ plugins was fixed (UI update issues) in extra pack and in base firmware pack**
* Plugins: Spectrum Analyzer - Modulation switching (hold OK) (by @ALEEF02 | PR #557)
* Plugins: BadBT -> Temp fix for macOS
* Plugins: Update TOTP (Authenticator) [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator) -> + added fix for UI update too
* Infrared: Add Play / Pause in universal projector remote
* Infrared: Update Universal remote assets (by @amec0e)
* SubGHz: Support for Ebyte E07 module power amp switch (works with TehRabbitt's Flux Capacitor Board) (by @Sil333033) (PR #559 by @Z3BRO) -> Remade by @xMasterX -> Driver code fixed and reworked by @gid9798
* Infrared: Update universal remote assets (by @amec0e | PR #570)
* Infrared: Update universal AC asset (by @Leptopt1los | PR #569)
* Plugins: Add * in NFC Maker keyboard (hold `.`)
* Plugins: Update TOTP (Authenticator) [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator)
* Plugins: Update ESP32: WiFi Marauder companion plugin [(by 0xchocolate)](https://github.com/0xchocolate/flipperzero-wifi-marauder)
* Plugins: Update ESP32-CAM -> Camera Suite [(by CodyTolene)](https://github.com/CodyTolene/Flipper-Zero-Camera-Suite) -> (PR #562 by @CodyTolene)
* OFW PR 2949: IR: buttons move feature rework (by nminaylov)
* OFW PR 2941: FDX-B temperature now uses system units (by Astrrra)
* OFW: fbtenv: add additional environ variable to control execution flow
* OFW: NFC CLI: Fix multiple apdu commands from not working when one of them gives an empty response
* OFW: NFC: Fix MFC key invalidation
* OFW: Rename Applications to Apps
* OFW: Fix about screen
* OFW: change FuriThreadPriorityIsr to 31 (configMAX_PRIORITIES-1)
* OFW: External apps icounter
* OFW: Overly missed feature: Infrared: move button (change button order in a remote)
* OFW: Move U2F path to ext
* OFW: New RTC flags in device info
* OFW: Backlight notification fix
* OFW: Fix fbtenv restore

----

Expand Down
5 changes: 3 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ Encoders made by @assasinfil & @xMasterX:
The majority of this project is developed and maintained by me, @xMasterX.
I'm unemployed, and the only income I receive is from your donations.
Our team is small and the guys are working on this project as much as they can solely based on the enthusiasm they have for this project and the community.
- @assasinfil - SubGHz
- @gid9798 - SubGHz, Plugins, many other things
- @assasinfil - SubGHz protocols
- @Svaarich - UI design and animations
- @Amec0e - Infrared assets
- @amec0e & @Leptopt1los - Infrared assets
- Community moderators in Telegram, Discord, and Reddit
- And of course our GitHub community. Your PRs are a very important part of this firmware and open-source development.

Expand Down
49 changes: 42 additions & 7 deletions applications/drivers/subghz/cc1101_ext/cc1101_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
#define TAG "SubGhz_Device_CC1101_Ext"

#define SUBGHZ_DEVICE_CC1101_EXT_TX_GPIO &gpio_ext_pb2
#define SUBGHZ_DEVICE_CC1101_EXT_DANGEROUS_RANGE false
#define SUBGHZ_DEVICE_CC1101_EXT_E07_AMP_GPIO &gpio_ext_pc3
#define SUBGHZ_DEVICE_CC1101_EXT_FORCE_DANGEROUS_RANGE false

#define SUBGHZ_DEVICE_CC1101_CONFIG_VER 1

/* DMA Channels definition */
#define SUBGHZ_DEVICE_CC1101_EXT_DMA DMA2
Expand Down Expand Up @@ -78,6 +81,8 @@ typedef struct {
const GpioPin* g0_pin;
SubGhzDeviceCC1101ExtAsyncTx async_tx;
SubGhzDeviceCC1101ExtAsyncRx async_rx;
bool power_amp;
bool extended_range;
} SubGhzDeviceCC1101Ext;

static SubGhzDeviceCC1101Ext* subghz_device_cc1101_ext = NULL;
Expand Down Expand Up @@ -187,24 +192,43 @@ static bool subghz_device_cc1101_ext_check_init() {
return ret;
}

bool subghz_device_cc1101_ext_alloc() {
bool subghz_device_cc1101_ext_alloc(SubGhzDeviceConf* conf) {
furi_assert(subghz_device_cc1101_ext == NULL);
subghz_device_cc1101_ext = malloc(sizeof(SubGhzDeviceCC1101Ext));
subghz_device_cc1101_ext->state = SubGhzDeviceCC1101ExtStateInit;
subghz_device_cc1101_ext->regulation = SubGhzDeviceCC1101ExtRegulationTxRx;
subghz_device_cc1101_ext->async_mirror_pin = NULL;
subghz_device_cc1101_ext->spi_bus_handle = &furi_hal_spi_bus_handle_external;
subghz_device_cc1101_ext->g0_pin = SUBGHZ_DEVICE_CC1101_EXT_TX_GPIO;
subghz_device_cc1101_ext->power_amp = false;
subghz_device_cc1101_ext->extended_range = false;
if(conf) {
if(conf->ver == SUBGHZ_DEVICE_CC1101_CONFIG_VER) {
subghz_device_cc1101_ext->power_amp = conf->power_amp;
subghz_device_cc1101_ext->extended_range = conf->extended_range;
} else {
FURI_LOG_E(TAG, "Config version mismatch");
}
}

subghz_device_cc1101_ext->async_rx.capture_delta_duration = 0;

furi_hal_spi_bus_handle_init(subghz_device_cc1101_ext->spi_bus_handle);
if(subghz_device_cc1101_ext->power_amp) {
furi_hal_gpio_init_simple(SUBGHZ_DEVICE_CC1101_EXT_E07_AMP_GPIO, GpioModeOutputPushPull);
}

return subghz_device_cc1101_ext_check_init();
}

void subghz_device_cc1101_ext_free() {
furi_assert(subghz_device_cc1101_ext != NULL);

furi_hal_spi_bus_handle_deinit(subghz_device_cc1101_ext->spi_bus_handle);
if(subghz_device_cc1101_ext->power_amp) {
furi_hal_gpio_init_simple(SUBGHZ_DEVICE_CC1101_EXT_E07_AMP_GPIO, GpioModeAnalog);
}

free(subghz_device_cc1101_ext);
subghz_device_cc1101_ext = NULL;
}
Expand All @@ -221,7 +245,7 @@ bool subghz_device_cc1101_ext_is_connect() {
bool ret = false;

if(subghz_device_cc1101_ext == NULL) { // not initialized
ret = subghz_device_cc1101_ext_alloc();
ret = subghz_device_cc1101_ext_alloc(NULL);
subghz_device_cc1101_ext_free();
} else { // initialized
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
Expand Down Expand Up @@ -381,19 +405,28 @@ void subghz_device_cc1101_ext_idle() {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_switch_to_idle(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
if(subghz_device_cc1101_ext->power_amp) {
furi_hal_gpio_write(SUBGHZ_DEVICE_CC1101_EXT_E07_AMP_GPIO, 0);
}
}

void subghz_device_cc1101_ext_rx() {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_switch_to_rx(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
if(subghz_device_cc1101_ext->power_amp) {
furi_hal_gpio_write(SUBGHZ_DEVICE_CC1101_EXT_E07_AMP_GPIO, 0);
}
}

bool subghz_device_cc1101_ext_tx() {
if(subghz_device_cc1101_ext->regulation != SubGhzDeviceCC1101ExtRegulationTxRx) return false;
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_switch_to_tx(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
if(subghz_device_cc1101_ext->power_amp) {
furi_hal_gpio_write(SUBGHZ_DEVICE_CC1101_EXT_E07_AMP_GPIO, 1);
}
return true;
}

Expand Down Expand Up @@ -432,14 +465,16 @@ bool subghz_device_cc1101_ext_is_frequency_valid(uint32_t value) {
}

bool subghz_device_cc1101_ext_is_tx_allowed(uint32_t value) {
if(!(SUBGHZ_DEVICE_CC1101_EXT_DANGEROUS_RANGE) &&
if(!(SUBGHZ_DEVICE_CC1101_EXT_FORCE_DANGEROUS_RANGE ||
subghz_device_cc1101_ext->extended_range) &&
!(value >= 299999755 && value <= 350000335) && // was increased from 348 to 350
!(value >= 386999938 && value <= 467750000) && // was increased from 464 to 467.75
!(value >= 778999847 && value <= 928000000)) {
FURI_LOG_I(TAG, "Frequency blocked - outside default range");
return false;
} else if(
(SUBGHZ_DEVICE_CC1101_EXT_DANGEROUS_RANGE) &&
(SUBGHZ_DEVICE_CC1101_EXT_FORCE_DANGEROUS_RANGE ||
subghz_device_cc1101_ext->extended_range) &&
!subghz_device_cc1101_ext_is_frequency_valid(value)) {
FURI_LOG_I(TAG, "Frequency blocked - outside dangerous range");
return false;
Expand Down Expand Up @@ -529,7 +564,7 @@ void subghz_device_cc1101_ext_start_async_rx(
furi_hal_bus_enable(FuriHalBusTIM17);

// Configure TIM
//Set the timer resolution to 2 µs
//Set the timer resolution to 2 us
LL_TIM_SetPrescaler(TIM17, (64 << 1) - 1);
LL_TIM_SetCounterMode(TIM17, LL_TIM_COUNTERMODE_UP);
LL_TIM_SetAutoReload(TIM17, 0xFFFF);
Expand Down Expand Up @@ -710,7 +745,7 @@ bool subghz_device_cc1101_ext_start_async_tx(SubGhzDeviceCC1101ExtCallback callb
furi_hal_bus_enable(FuriHalBusTIM17);

// Configure TIM
// Set the timer resolution to 2 µs
// Set the timer resolution to 2 us
LL_TIM_SetPrescaler(TIM17, (64 << 1) - 1);
LL_TIM_SetCounterMode(TIM17, LL_TIM_COUNTERMODE_UP);
LL_TIM_SetAutoReload(TIM17, 0xFFFF);
Expand Down
3 changes: 2 additions & 1 deletion applications/drivers/subghz/cc1101_ext/cc1101_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#pragma once
#include <lib/subghz/devices/preset.h>
#include <lib/subghz/devices/types.h>
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
Expand Down Expand Up @@ -34,7 +35,7 @@ const GpioPin* subghz_device_cc1101_ext_get_data_gpio();
*
* @return true if success
*/
bool subghz_device_cc1101_ext_alloc();
bool subghz_device_cc1101_ext_alloc(SubGhzDeviceConf* conf);

/** Deinitialize device
*/
Expand Down
4 changes: 2 additions & 2 deletions applications/external/camera_suite/application.fam
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
App(
appid="camerasuite",
appid="camera_suite",
apptype=FlipperAppType.EXTERNAL,
cdefines=["APP_CAMERA_SUITE"],
entry_point="camera_suite_app",
fap_author="Cody Tolene",
fap_author="@CodyTolene @Z4urce @leedave",
fap_category="GPIO",
fap_description="A camera suite application for the Flipper Zero ESP32-CAM module.",
fap_icon="icons/camera_suite.png",
Expand Down
25 changes: 9 additions & 16 deletions applications/external/camera_suite/camera_suite.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void camera_suite_tick_event_callback(void* context) {
scene_manager_handle_tick_event(app->scene_manager);
}

//leave app if back button pressed
// Leave app if back button pressed.
bool camera_suite_navigation_event_callback(void* context) {
furi_assert(context);
CameraSuite* app = context;
Expand All @@ -25,10 +25,10 @@ CameraSuite* camera_suite_app_alloc() {
app->gui = furi_record_open(RECORD_GUI);
app->notification = furi_record_open(RECORD_NOTIFICATION);

//Turn backlight on, believe me this makes testing your app easier
// Turn backlight on.
notification_message(app->notification, &sequence_display_backlight_on);

//Scene additions
// Scene additions
app->view_dispatcher = view_dispatcher_alloc();
view_dispatcher_enable_queue(app->view_dispatcher);

Expand Down Expand Up @@ -60,17 +60,11 @@ CameraSuite* camera_suite_app_alloc() {
CameraSuiteViewIdStartscreen,
camera_suite_view_start_get_view(app->camera_suite_view_start));

app->camera_suite_view_style_1 = camera_suite_view_style_1_alloc();
app->camera_suite_view_camera = camera_suite_view_camera_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
CameraSuiteViewIdScene1,
camera_suite_view_style_1_get_view(app->camera_suite_view_style_1));

app->camera_suite_view_style_2 = camera_suite_view_style_2_alloc();
view_dispatcher_add_view(
app->view_dispatcher,
CameraSuiteViewIdScene2,
camera_suite_view_style_2_get_view(app->camera_suite_view_style_2));
CameraSuiteViewIdCamera,
camera_suite_view_camera_get_view(app->camera_suite_view_camera));

app->camera_suite_view_guide = camera_suite_view_guide_alloc();
view_dispatcher_add_view(
Expand Down Expand Up @@ -98,9 +92,9 @@ void camera_suite_app_free(CameraSuite* app) {
scene_manager_free(app->scene_manager);

// View Dispatcher
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdStartscreen);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdMenu);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdScene1);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdScene2);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdCamera);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdGuide);
view_dispatcher_remove_view(app->view_dispatcher, CameraSuiteViewIdSettings);
submenu_free(app->submenu);
Expand All @@ -110,8 +104,7 @@ void camera_suite_app_free(CameraSuite* app) {

// Free remaining resources
camera_suite_view_start_free(app->camera_suite_view_start);
camera_suite_view_style_1_free(app->camera_suite_view_style_1);
camera_suite_view_style_2_free(app->camera_suite_view_style_2);
camera_suite_view_camera_free(app->camera_suite_view_camera);
camera_suite_view_guide_free(app->camera_suite_view_guide);
button_menu_free(app->button_menu);
variable_item_list_free(app->variable_item_list);
Expand Down
10 changes: 3 additions & 7 deletions applications/external/camera_suite/camera_suite.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include "scenes/camera_suite_scene.h"
#include "views/camera_suite_view_guide.h"
#include "views/camera_suite_view_start.h"
#include "views/camera_suite_view_style_1.h"
#include "views/camera_suite_view_style_2.h"
#include <assets_icons.h>
#include "views/camera_suite_view_camera.h"
#include <furi.h>
#include <furi_hal.h>
#include <gui/gui.h>
Expand All @@ -29,8 +27,7 @@ typedef struct {
SceneManager* scene_manager;
VariableItemList* variable_item_list;
CameraSuiteViewStart* camera_suite_view_start;
CameraSuiteViewStyle1* camera_suite_view_style_1;
CameraSuiteViewStyle2* camera_suite_view_style_2;
CameraSuiteViewCamera* camera_suite_view_camera;
CameraSuiteViewGuide* camera_suite_view_guide;
uint32_t orientation;
uint32_t haptic;
Expand All @@ -42,8 +39,7 @@ typedef struct {
typedef enum {
CameraSuiteViewIdStartscreen,
CameraSuiteViewIdMenu,
CameraSuiteViewIdScene1,
CameraSuiteViewIdScene2,
CameraSuiteViewIdCamera,
CameraSuiteViewIdGuide,
CameraSuiteViewIdSettings,
} CameraSuiteViewId;
Expand Down
20 changes: 20 additions & 0 deletions applications/external/camera_suite/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## v1.1

- Support and picture stabilization for all camera orientations (0°, 90°, 180°, 270°).
- Rename "Scene 1" to "Camera". No UX changes, strictly internal.
- Clean up unused "Scene 2". This was inaccessible to users previously and unused.
- Add new dithering variations (needs new module firmware, see https://github.com/CodyTolene/Flipper-Zero-Camera-Suite#firmware-installation):
- Add `Jarvis Judice` Ninke Dithering option
- Add `Stucki` dithering option.
- Add ability to toggle dithering options from default `Floyd-Steinberg` and back.
- Resolves issue https://github.com/CodyTolene/Flipper-Zero-Camera-Suite/issues/7
- Resolves issue https://github.com/CodyTolene/Flipper-Zero-Camera-Suite/pull/17

## v1.0

- Builds upon Z4urce's software found here (updated 6 months ago): https://github.com/Z4urce/flipperzero-camera
- Utilizes the superb C boilerplate examples laid out by leedave (updated last month): https://github.com/leedave/flipper-zero-fap-boilerplate
- Repurpose and build upon the "[ESP32] Camera" software into the new "[ESP32] Camera Suite" application with new purpose:
- Adding more scene for a guide.
- Adding more scene for saveable settings.
- Add ability to rotate the camera orientation.
35 changes: 35 additions & 0 deletions applications/external/camera_suite/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Flipper Zero - Camera Suite

Software to run an ESP32-CAM module on your Flipper Zero device.

## Software Guide <a name="software-guide"></a>

### Flipper Zero button mappings:

🔼 = Contrast Up

🔽 = Contrast Down

◀️ = Toggle invert.

▶️ = Toggle dithering on/off.

⚪ = Cycle Floyd–Steinberg/Jarvis-Judice-Ninke/Stucki dithering types.

↩️ = Go back.

### Camera Suite settings:

**Orientation** = Rotate the camera image 90 degrees counter-clockwise starting at zero by default (0, 90, 180, 270). This is useful if you have your camera module mounted in a different orientation than the default.

**Haptic FX** = Toggle haptic feedback on/off.

**Sound FX** = Toggle sound effects on/off.

**LED FX** = Toggle LED effects on/off.

## Links

Full setup, wiring guide, etc. in the main project README here: https://github.com/CodyTolene/Flipper-Zero-Camera-Suite

A firmware is needed for the ESP32-CAM module, see here for more information: https://github.com/CodyTolene/Flipper-Zero-Camera-Suite#firmware-installation
Loading

0 comments on commit 4b8c017

Please sign in to comment.