Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
V48 Release Candidate Changes (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jun 3, 2023
2 parents ce62f4d + 25eed74 commit 8b9af91
Show file tree
Hide file tree
Showing 379 changed files with 17,169 additions and 4,575 deletions.
4 changes: 4 additions & 0 deletions .github/workflow_data/hotfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@
if not req.ok:
print(f"{req.url = }\n{req.status_code = }\n{req.content = }")
sys.exit(1)

changelog = body.split("## 🚀 Changelog", 1)[1].rsplit("## ❤️ Support", 1)[0]
with open(os.environ["ARTIFACT_TGZ"].removesuffix(".tgz") + ".md", "w") as f:
f.write(changelog.strip() + "\n\n")
3 changes: 0 additions & 3 deletions .github/workflow_data/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ cd ${ARTIFACT_DIR}
7z a ../../../${ARTIFACT_ZIP} .
cd ../../..

python -m pip install pyncclient
NC_FILE=${ARTIFACT_TGZ} NC_PATH=XFW-Updater python .github/workflow_data/webupdater.py

echo "ARTIFACT_TGZ=${ARTIFACT_TGZ}" >> $GITHUB_ENV
echo "ARTIFACT_ZIP=${ARTIFACT_ZIP}" >> $GITHUB_ENV
1 change: 0 additions & 1 deletion .github/workflow_data/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
>### [📦 Zipped Archive (.zip)](https://github.com/ClaraCrazy/Flipper-Xtreme/releases/download/{VERSION_TAG}/{ARTIFACT_ZIP})
**Remember to delete your `apps` folders before updating!**\
**Check the [install guide](https://github.com/ClaraCrazy/Flipper-Xtreme#install) if you're not sure, or [join our Discord](https://discord.gg/flipper-xtreme) if you have questions or encounter issues!**

## 🚀 Changelog
Expand Down
2 changes: 2 additions & 0 deletions .github/workflow_data/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
)
with open(notes_path, "w") as f:
f.write(notes)
with open(os.environ["ARTIFACT_TGZ"].removesuffix(".tgz") + ".md", "w") as f:
f.write(changelog.strip() + "\n\n")
20 changes: 14 additions & 6 deletions .github/workflow_data/webupdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
client = nextcloud_client.Client(os.environ["NC_HOST"])
client.login(os.environ["NC_USER"], os.environ["NC_PASS"])

file = os.environ["NC_FILE"]
path = os.environ["NC_PATH"] + "/" + file
file = os.environ["ARTIFACT_TGZ"]
path = f"XFW-Updater/{file}"
try:
client.delete(path)
except Exception:
Expand All @@ -16,12 +16,20 @@

file = file.removesuffix(".tgz") + ".md"
path = path.removesuffix(".tgz") + ".md"
with open(os.environ['GITHUB_EVENT_PATH'], "r") as f:
changelog = json.load(f)['pull_request']['body']
with open(file, "w") as f:
f.write(changelog)
try:
client.delete(path)
except Exception:
pass
client.put_file(path, file)

version = os.environ['VERSION_TAG'].split("_")[0]
files = (
os.environ['ARTIFACT_TGZ'],
os.environ['ARTIFACT_TGZ'].removesuffix(".tgz") + ".md"
)
for file in client.list("XFW-Updater"):
if file.name.startswith(version) and file.name not in files:
try:
client.delete(file.path)
except Exception:
pass
19 changes: 13 additions & 6 deletions .github/workflows/hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,24 @@ jobs:
- name: "Read version tag"
run: bash .github/workflow_data/version.sh

- name: "Make tgz, zip and webupdater"
- name: "Make tgz and zip"
run: bash .github/workflow_data/package.sh
env:
NC_HOST: "https://cloud.cynthialabs.net/"
NC_USER: "${{ secrets.NC_USER }}"
NC_PASS: "${{ secrets.NC_PASS }}"

- name: "Upload hotfix"
run: python .github/workflow_data/hotfix.py
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
python -m pip install requests
python .github/workflow_data/hotfix.py
- name: "Upload to webupdater"
env:
NC_HOST: "https://cloud.cynthialabs.net/"
NC_USER: "${{ secrets.NC_USER }}"
NC_PASS: "${{ secrets.NC_PASS }}"
run: |
python -m pip install pyncclient
python .github/workflow_data/webupdater.py
- name: "Merge pull request"
uses: "pascalgn/[email protected]"
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,20 @@ jobs:
- name: "Read version tag"
run: bash .github/workflow_data/version.sh

- name: "Make tgz, zip and webupdater"
- name: "Make tgz and zip"
run: bash .github/workflow_data/package.sh

- name: "Update release notes"
run: python .github/workflow_data/release.py

- name: "Upload to webupdater"
env:
NC_HOST: "https://cloud.cynthialabs.net/"
NC_USER: "${{ secrets.NC_USER }}"
NC_PASS: "${{ secrets.NC_PASS }}"

- name: "Update release notes"
run: python .github/workflow_data/release.py
run: |
python -m pip install pyncclient
python .github/workflow_data/webupdater.py
- name: "Merge pull request"
uses: "pascalgn/[email protected]"
Expand Down
27 changes: 13 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,29 @@ bindings/
.mxproject
Brewfile.lock.json

# Visual Studio Code
/.vscode/

# Visual Studio
.vs/

# Kate
.kateproject
.kateconfig

# legendary cmake's
build
CMakeLists.txt

# bundle output
dist

# kde
.directory
null.d

# SCons
.sconsign.dblite


# Visual Studio Code
/.vscode

# Visual Studio
/.vs

# bundle output
/dist

# SCons build dir
build/
/build

# Toolchain
/toolchain
Expand All @@ -69,6 +67,7 @@ PVS-Studio.log

.gdbinit

/fbt_options_local.py

# XFW-specific:

Expand Down
4 changes: 2 additions & 2 deletions applications/debug/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ App(
"vibro_test",
"keypad_test",
"usb_test",
"USB_Mouse",
"UART_Echo",
"usb_mouse",
"uart_echo",
"display_test",
"text_box_test",
"file_browser_test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ void lfrfid_debug_scene_tune_on_enter(void* context) {
furi_hal_rfid_comp_set_callback(comparator_trigger_callback, app);
furi_hal_rfid_comp_start();

furi_hal_rfid_pins_read();
furi_hal_rfid_tim_read(125000, 0.5);
furi_hal_rfid_tim_read_start();
furi_hal_rfid_tim_read_start(125000, 0.5);

view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidDebugViewTune);
}
Expand All @@ -43,6 +41,5 @@ void lfrfid_debug_scene_tune_on_exit(void* context) {

furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeAnalog);
furi_hal_rfid_tim_read_stop();
furi_hal_rfid_tim_reset();
furi_hal_rfid_pins_reset();
}
61 changes: 52 additions & 9 deletions applications/debug/unit_tests/nfc/nfc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ static const uint32_t nfc_test_file_version = 1;
#define NFC_TEST_DATA_MAX_LEN 18
#define NFC_TETS_TIMINGS_MAX_LEN 1350

// Maximum allowed time for buffer preparation to fit 500us nt message timeout
#define NFC_TEST_4_BYTE_BUILD_BUFFER_TIM_MAX (150)
#define NFC_TEST_16_BYTE_BUILD_BUFFER_TIM_MAX (640)
#define NFC_TEST_4_BYTE_BUILD_SIGNAL_TIM_MAX (110)
#define NFC_TEST_16_BYTE_BUILD_SIGNAL_TIM_MAX (440)

typedef struct {
Storage* storage;
NfcaSignal* signal;
Expand Down Expand Up @@ -91,13 +97,13 @@ static bool nfc_test_read_signal_from_file(const char* file_name) {

static bool nfc_test_digital_signal_test_encode(
const char* file_name,
uint32_t encode_max_time,
uint32_t build_signal_max_time_us,
uint32_t build_buffer_max_time_us,
uint32_t timing_tolerance,
uint32_t timings_sum_tolerance) {
furi_assert(nfc_test);

bool success = false;
uint32_t time = 0;
uint32_t dut_timings_sum = 0;
uint32_t ref_timings_sum = 0;
uint8_t parity[10] = {};
Expand All @@ -111,17 +117,37 @@ static bool nfc_test_digital_signal_test_encode(

// Encode signal
FURI_CRITICAL_ENTER();
time = DWT->CYCCNT;
uint32_t time_start = DWT->CYCCNT;

nfca_signal_encode(
nfc_test->signal, nfc_test->test_data, nfc_test->test_data_len * 8, parity);

uint32_t time_signal =
(DWT->CYCCNT - time_start) / furi_hal_cortex_instructions_per_microsecond();

time_start = DWT->CYCCNT;

digital_signal_prepare_arr(nfc_test->signal->tx_signal);
time = (DWT->CYCCNT - time) / furi_hal_cortex_instructions_per_microsecond();

uint32_t time_buffer =
(DWT->CYCCNT - time_start) / furi_hal_cortex_instructions_per_microsecond();
FURI_CRITICAL_EXIT();

// Check timings
if(time > encode_max_time) {
if(time_signal > build_signal_max_time_us) {
FURI_LOG_E(
TAG, "Encoding time: %ld us while accepted value: %ld us", time, encode_max_time);
TAG,
"Build signal time: %ld us while accepted value: %ld us",
time_signal,
build_signal_max_time_us);
break;
}
if(time_buffer > build_buffer_max_time_us) {
FURI_LOG_E(
TAG,
"Build buffer time: %ld us while accepted value: %ld us",
time_buffer,
build_buffer_max_time_us);
break;
}

Expand Down Expand Up @@ -158,7 +184,16 @@ static bool nfc_test_digital_signal_test_encode(
break;
}

FURI_LOG_I(TAG, "Encoding time: %ld us. Acceptable time: %ld us", time, encode_max_time);
FURI_LOG_I(
TAG,
"Build signal time: %ld us. Acceptable time: %ld us",
time_signal,
build_signal_max_time_us);
FURI_LOG_I(
TAG,
"Build buffer time: %ld us. Acceptable time: %ld us",
time_buffer,
build_buffer_max_time_us);
FURI_LOG_I(
TAG,
"Timings sum difference: %ld [1/64MHZ]. Acceptable difference: %ld [1/64MHz]",
Expand All @@ -173,11 +208,19 @@ static bool nfc_test_digital_signal_test_encode(
MU_TEST(nfc_digital_signal_test) {
mu_assert(
nfc_test_digital_signal_test_encode(
NFC_TEST_RESOURCES_DIR NFC_TEST_SIGNAL_SHORT_FILE, 500, 1, 37),
NFC_TEST_RESOURCES_DIR NFC_TEST_SIGNAL_SHORT_FILE,
NFC_TEST_4_BYTE_BUILD_SIGNAL_TIM_MAX,
NFC_TEST_4_BYTE_BUILD_BUFFER_TIM_MAX,
1,
37),
"NFC short digital signal test failed\r\n");
mu_assert(
nfc_test_digital_signal_test_encode(
NFC_TEST_RESOURCES_DIR NFC_TEST_SIGNAL_LONG_FILE, 2000, 1, 37),
NFC_TEST_RESOURCES_DIR NFC_TEST_SIGNAL_LONG_FILE,
NFC_TEST_16_BYTE_BUILD_SIGNAL_TIM_MAX,
NFC_TEST_16_BYTE_BUILD_BUFFER_TIM_MAX,
1,
37),
"NFC long digital signal test failed\r\n");
}

Expand Down
2 changes: 1 addition & 1 deletion applications/debug/usb_mouse/application.fam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
App(
appid="USB_Mouse",
appid="usb_mouse",
name="USB Mouse",
apptype=FlipperAppType.DEBUG,
entry_point="usb_mouse_app",
Expand Down
2 changes: 1 addition & 1 deletion applications/external/arkanoid/application.fam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
App(
appid="Arkanoid",
appid="arkanoid",
name="Arkanoid",
apptype=FlipperAppType.EXTERNAL,
entry_point="arkanoid_game_app",
Expand Down
2 changes: 1 addition & 1 deletion applications/external/blackjack/application.fam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
App(
appid="Blackjack",
appid="blackjack",
name="BlackJack",
apptype=FlipperAppType.EXTERNAL,
entry_point="blackjack_app",
Expand Down
2 changes: 1 addition & 1 deletion applications/external/blackjack/blackjack.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "util.h"
#include "ui.h"

#include "Blackjack_icons.h"
#include "blackjack_icons.h"

#define DEALER_MAX 17

Expand Down
2 changes: 1 addition & 1 deletion applications/external/doom/application.fam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
App(
appid="DOOM",
appid="doom",
name="DOOM",
apptype=FlipperAppType.EXTERNAL,
entry_point="doom_app",
Expand Down
2 changes: 1 addition & 1 deletion applications/external/dtmf_dolphin/dtmf_dolphin_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ bool dtmf_dolphin_audio_play_tones(
generate_waveform(current_player, 0);
generate_waveform(current_player, current_player->half_buffer_length);

dtmf_dolphin_speaker_init();
dtmf_dolphin_dma_init((uint32_t)current_player->sample_buffer, current_player->buffer_length);

furi_hal_interrupt_set_isr(
FuriHalInterruptIdDma1Ch1, dtmf_dolphin_audio_dma_isr, current_player->queue);
if(furi_hal_speaker_acquire(1000)) {
dtmf_dolphin_speaker_init();
dtmf_dolphin_dma_start();
dtmf_dolphin_speaker_start();
current_player->playing = true;
Expand Down
15 changes: 15 additions & 0 deletions applications/external/esp32cam_camera/application.fam
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
App(
appid="MAYHEM_Camera",
name="[MAYHEM] Camera",
apptype=FlipperAppType.EXTERNAL,
entry_point="camera_app",
cdefines=["APP_CAMERA"],
requires=["gui"],
stack_size=8 * 1024,
order=1,
fap_icon="icon.png",
fap_category="GPIO",
fap_description="ESP32-CAM live feed and photo capture, use left/right for orientation/mode, up/down for brightness and center for saving a screenshot. [Unplug the USB cable to test with Mayhem]",
fap_author="Z4urce",
fap_weburl="https://github.com/Z4urce/flipper-camera",
)
Loading

0 comments on commit 8b9af91

Please sign in to comment.