Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Install with web updater'
body-includes: 'Compiled firmware for commit'

- name: 'Create or update comment'
if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request}}
Expand All @@ -153,7 +153,10 @@ jobs:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
[Install with web updater](https://my.flipp.dev/?url=https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-update-${{steps.names.outputs.suffix}}.tgz&channel=${{steps.names.outputs.artifacts-path}}&version=${{steps.names.outputs.short-hash}}).
**Compiled firmware for commit `${{steps.names.outputs.short-hash}}`:**
- [📦 Update package](https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-update-${{steps.names.outputs.suffix}}.tgz)
- [📥 DFU file](https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-full-${{steps.names.outputs.suffix}}.dfu)
- [☁️ Web updater](https://my.flipp.dev/?url=https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-update-${{steps.names.outputs.suffix}}.tgz&channel=${{steps.names.outputs.artifacts-path}}&version=${{steps.names.outputs.short-hash}})
edit-mode: replace

compact:
Expand Down
10 changes: 8 additions & 2 deletions applications/nfc/nfc_worker.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "nfc_worker_i.h"
#include <furi_hal.h>

#include <platform.h>

#define TAG "NfcWorker"

/***************************** NFC Worker API *******************************/
Expand Down Expand Up @@ -495,9 +497,11 @@ void nfc_worker_emulate_mifare_classic(NfcWorker* nfc_worker) {
NfcaSignal* nfca_signal = nfca_signal_alloc();
tx_rx.nfca_signal = nfca_signal;

rfal_platform_spi_acquire();

furi_hal_nfc_listen_start(nfc_data);
while(nfc_worker->state == NfcWorkerStateEmulateMifareClassic) {
if(furi_hal_nfc_listen(
nfc_data->uid, nfc_data->uid_len, nfc_data->atqa, nfc_data->sak, true, 300)) {
if(furi_hal_nfc_listen_rx(&tx_rx, 300)) {
mf_classic_emulator(&emulator, &tx_rx);
}
}
Expand All @@ -510,6 +514,8 @@ void nfc_worker_emulate_mifare_classic(NfcWorker* nfc_worker) {
}

nfca_signal_free(nfca_signal);

rfal_platform_spi_release();
}

void nfc_worker_read_mifare_desfire(NfcWorker* nfc_worker) {
Expand Down
3 changes: 3 additions & 0 deletions applications/subghz/helpers/subghz_custom_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ typedef enum {
SubGhzCustomEventSceneShowOnlyRX,
SubGhzCustomEventSceneAnalyzerLock,
SubGhzCustomEventSceneAnalyzerUnlock,
SubGhzCustomEventSceneSettingLock,

SubGhzCustomEventSceneExit,
SubGhzCustomEventSceneStay,

SubGhzCustomEventViewReceiverOK,
SubGhzCustomEventViewReceiverConfig,
SubGhzCustomEventViewReceiverBack,
SubGhzCustomEventViewReceiverOffDisplay,
SubGhzCustomEventViewReceiverUnlock,

SubGhzCustomEventViewReadRAWBack,
SubGhzCustomEventViewReadRAWIDLE,
Expand Down
69 changes: 69 additions & 0 deletions applications/subghz/helpers/subghz_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#pragma once

/** SubGhzNotification state */
typedef enum {
SubGhzNotificationStateStarting,
SubGhzNotificationStateIDLE,
SubGhzNotificationStateTx,
SubGhzNotificationStateRx,
SubGhzNotificationStateRxDone,
} SubGhzNotificationState;

/** SubGhzTxRx state */
typedef enum {
SubGhzTxRxStateIDLE,
SubGhzTxRxStateRx,
SubGhzTxRxStateTx,
SubGhzTxRxStateSleep,
} SubGhzTxRxState;

/** SubGhzHopperState state */
typedef enum {
SubGhzHopperStateOFF,
SubGhzHopperStateRunnig,
SubGhzHopperStatePause,
SubGhzHopperStateRSSITimeOut,
} SubGhzHopperState;

/** SubGhzRxKeyState state */
typedef enum {
SubGhzRxKeyStateIDLE,
SubGhzRxKeyStateNoSave,
SubGhzRxKeyStateNeedSave,
SubGhzRxKeyStateBack,
SubGhzRxKeyStateStart,
SubGhzRxKeyStateAddKey,
SubGhzRxKeyStateExit,
SubGhzRxKeyStateRAWLoad,
SubGhzRxKeyStateRAWSave,
} SubGhzRxKeyState;

/** SubGhzLoadKeyState state */
typedef enum {
SubGhzLoadKeyStateUnknown,
SubGhzLoadKeyStateOK,
SubGhzLoadKeyStateParseErr,
SubGhzLoadKeyStateOnlyRx,
} SubGhzLoadKeyState;

/** SubGhzLock */
typedef enum {
SubGhzLockOff,
SubGhzLockOn,
} SubGhzLock;

typedef enum {
SubGhzViewIdMenu,
SubGhzViewIdReceiver,
SubGhzViewIdPopup,
SubGhzViewIdTextInput,
SubGhzViewIdWidget,
SubGhzViewIdTransmitter,
SubGhzViewIdVariableItemList,
SubGhzViewIdFrequencyAnalyzer,
SubGhzViewIdReadRAW,

SubGhzViewIdStatic,
SubGhzViewIdTestCarrier,
SubGhzViewIdTestPacket,
} SubGhzViewId;
23 changes: 12 additions & 11 deletions applications/subghz/scenes/subghz_scene_read_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void subghz_scene_read_raw_on_enter(void* context) {

bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case SubGhzCustomEventViewReadRAWBack:
Expand Down Expand Up @@ -141,7 +142,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
}
}
}
return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWTXRXStop:
Expand All @@ -156,14 +157,14 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
subghz_sleep(subghz);
};
subghz->state_notifications = SubGhzNotificationStateIDLE;
return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWConfig:
scene_manager_set_scene_state(
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerSet);
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiverConfig);
return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWErase:
Expand All @@ -175,7 +176,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
}
subghz->txrx->rx_key_state = SubGhzRxKeyStateIDLE;
notification_message(subghz->notifications, &sequence_reset_rgb);
return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWMore:
Expand All @@ -184,7 +185,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
subghz->scene_manager, SubGhzSceneReadRAW, SubGhzCustomEventManagerSet);
subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneMoreRAW);
return true;
consumed = true;
} else {
furi_crash("SubGhz: RAW file name update error.");
}
Expand Down Expand Up @@ -214,7 +215,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
}
}
}
return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWSendStop:
Expand All @@ -224,7 +225,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
subghz_sleep(subghz);
}
subghz_read_raw_stop_send(subghz->subghz_read_raw);
return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWIDLE:
Expand Down Expand Up @@ -255,7 +256,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
subghz->state_notifications = SubGhzNotificationStateIDLE;
subghz->txrx->rx_key_state = SubGhzRxKeyStateAddKey;

return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWREC:
Expand All @@ -281,7 +282,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
}
}
return true;
consumed = true;
break;

case SubGhzCustomEventViewReadRAWSave:
Expand All @@ -291,7 +292,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
subghz->txrx->rx_key_state = SubGhzRxKeyStateBack;
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
}
return true;
consumed = true;
break;

default:
Expand All @@ -315,7 +316,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
break;
}
}
return false;
return consumed;
}

void subghz_scene_read_raw_on_exit(void* context) {
Expand Down
45 changes: 37 additions & 8 deletions applications/subghz/scenes/subghz_scene_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ static const NotificationSequence subghs_sequence_rx = {
NULL,
};

static const NotificationSequence subghs_sequence_rx_locked = {
&message_green_255,

&message_display_backlight_on,

&message_vibro_on,
&message_note_c6,
&message_delay_50,
&message_sound_off,
&message_vibro_off,

&message_delay_500,

&message_display_backlight_off,
NULL,
};

static void subghz_scene_receiver_update_statusbar(void* context) {
SubGhz* subghz = context;
string_t history_stat_str;
Expand Down Expand Up @@ -92,6 +109,8 @@ void subghz_scene_receiver_on_enter(void* context) {
subghz->txrx->rx_key_state = SubGhzRxKeyStateStart;
}

subghz_view_receiver_set_lock(subghz->subghz_receiver, subghz->lock);

//Load history to receiver
subghz_view_receiver_exit(subghz->subghz_receiver);
for(uint8_t i = 0; i < subghz_history_get_item(subghz->txrx->history); i++) {
Expand Down Expand Up @@ -126,11 +145,10 @@ void subghz_scene_receiver_on_enter(void* context) {

bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context;

bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case SubGhzCustomEventViewReceiverBack:

// Stop CC1101 Rx
subghz->state_notifications = SubGhzNotificationStateIDLE;
if(subghz->txrx->txrx_state == SubGhzTxRxStateRx) {
Expand All @@ -151,20 +169,28 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
scene_manager_search_and_switch_to_previous_scene(
subghz->scene_manager, SubGhzSceneStart);
}
return true;
consumed = true;
break;
case SubGhzCustomEventViewReceiverOK:
subghz->txrx->idx_menu_chosen =
subghz_view_receiver_get_idx_menu(subghz->subghz_receiver);
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiverInfo);
return true;
consumed = true;
break;
case SubGhzCustomEventViewReceiverConfig:
subghz->state_notifications = SubGhzNotificationStateIDLE;
subghz->txrx->idx_menu_chosen =
subghz_view_receiver_get_idx_menu(subghz->subghz_receiver);
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiverConfig);
return true;
consumed = true;
break;
case SubGhzCustomEventViewReceiverOffDisplay:
notification_message(subghz->notifications, &sequence_display_backlight_off);
consumed = true;
break;
case SubGhzCustomEventViewReceiverUnlock:
subghz->lock = SubGhzLockOff;
consumed = true;
break;
default:
break;
Expand All @@ -174,20 +200,23 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
subghz_hopper_update(subghz);
subghz_scene_receiver_update_statusbar(subghz);
}

switch(subghz->state_notifications) {
case SubGhzNotificationStateRx:
notification_message(subghz->notifications, &sequence_blink_cyan_10);
break;
case SubGhzNotificationStateRxDone:
notification_message(subghz->notifications, &subghs_sequence_rx);
if(subghz->lock != SubGhzLockOn) {
notification_message(subghz->notifications, &subghs_sequence_rx);
} else {
notification_message(subghz->notifications, &subghs_sequence_rx_locked);
}
subghz->state_notifications = SubGhzNotificationStateRx;
break;
default:
break;
}
}
return false;
return consumed;
}

void subghz_scene_receiver_on_exit(void* context) {
Expand Down
Loading