Skip to content

Commit

Permalink
Merge branch 'dev' into better-pet
Browse files Browse the repository at this point in the history
  • Loading branch information
vollukas committed Feb 4, 2025
2 parents 3ff9ad1 + 9656079 commit a386537
Show file tree
Hide file tree
Showing 1,015 changed files with 4,921 additions and 1,094 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @Willy-JL @Sil333033 @HaxSam @MatthewKuKanich
* @Willy-JL @Sil333033 @HaxSam @MatthewKuKanich @956MB
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
git diff --exit-code
- name: "Upload artifacts to GitHub"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: |
dist/${{ env.TARGET }}-*/flipper-z-${{ env.TARGET }}-update-*
Expand Down
84 changes: 74 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,85 @@
### Breaking Changes:
- Lockscreen: Separate 'Allow RPC While Locked' settings for USB/BLE (#343 by @956MB)
- Both default to OFF like before
- If you had enabled this option before, you will need to re-enable

### Added:
- Nothing
- Apps:
- Games: Pinball0 (by @rdefeo)
- GPIO: FlipperHTTP: FlipWorld (by @jblanked)
- GPIO: TEA5767 FM Radio (by @coolshrimp)
- NFC: Metroflip (by @luu176)
- USB: USB Game Controller (by @expected-ingot)
- Infrared:
- Easy Learn mode to quickly save buttons without typing (#350 by @jaylikesbunda)
- Move Easy Learn and Learn RAW toggles inside Learning/Receiving screen for quick access, RAW mode doesn't require Debug anymore (by @Willy-JL)
- Archive: Setting to show dynamic path in file browser statusbar (#322 by @956MB)
- CLI: Add `clear` and `cls` commands, add `did you mean ...?` command suggestion (#342 by @dexvleads)
- Main Menu: Add coverflow menu style (#314 by @CodyTolene)
- MNTM Settings: Add Menu Style submenu for easier selection (#359 by @jaylikesbunda)
- BadKB: Added german Mac keyboard Layout (#325 by @Cloudy261)
- UL: Sub-GHz: Jolly Motors support with add manually (by @pkooiman & @xMasterX)
- OFW: Desktop: Add winter animations (by @Astrrra)
- API:
- Added `canvas_draw_icon_animation_ex()` to draw animated icons resized (#314 by @CodyTolene)
- OFW: Added `flipper_format_write_empty_line()` (by @janwiesemann)
- OFW: Furi: Pipe support (by @portasynthinca3)
- OFW: Furi: Thread stdin support (by @portasynthinca3)
- OFW: RPC: Command to send a signal once (by @Astrrra)
- OFW: Add VCP break support (by @gsurkov)

### Updated:
- Apps:
- FlipLibrary: Added dog facts and random quotes, bug fixes (by @jblanked), connectivity and progress improvements (by @jamisonderek)
- FlipSocial: Improved authentication (by @jblanked)
- FlipStore: Many bugfixes, support ESP32 firmware downloads, allow deleting apps (by @jblanked)
- FlipWeather: Stability improvements (by @jblanked)
- FlipWiFi: Improved error handling (by @jblanked)
- BT/USB Remote: Add PTT support for Gather (by @SapphicCode)
- Chess: Fix illegal move bug (by @956MB)
- Color Guess: Simplify app code (by @leedave)
- Countdown Timer: Default to 60 seconds on open (by @andrejka27)
- Cross Remote: Fix Sub-GHz actions rolling code support, animations for transmit, allow interrupting chain (by @leedave), loop transmit feature (by @miccayo)
- ESP Flasher: Add c3 and c6 to s3 option (by @jaylikesbunda), update bins for Marauder to 1.2.0 (by @justcallmekoko) and FlipperHTTP to 1.6.1 (by @jblanked)
- FlipBIP: Refactor to make adding coins easier (by @xtruan)
- uPython: Enabled extra functions for the `random` module (by @ofabel)
- Pokemon Trade Tool: Update to gblink v0.63 which includes saving/loading of pin configurations for the EXT link interface (by @kbembedded)
- FlipLibrary: Wikipedia, dog facts, random quotes, weather, asset price, predictions, trivia, advice, uuid and many more, bug fixes (by @jblanked), holidays, improvements to connectivity and progress (by @jamisonderek)
- FlipSocial: Improved authentication, loading screens, many bug fixes, bio and friend counts, new feed screen with posted time, search users and contacts, home announcements and notifications, private feed option, endless feed (by @jblanked), RPC_KEYBOARD support (by @jamisonderek)
- FlipStore: Many bugfixes, support downloading ESP32 and VGM firmwares and Github repos, allow deleting apps, memory fixes, update Marauder, use Flipper catalog API (by @jblanked), more improvements (by @jamisonderek)
- FlipTrader: Improved progress display, added connectivity check on startup (by @jamisonderek)
- FlipWeather: Stability improvements (by @jblanked), improved progress display, added connectivity check on startup (by @jamisonderek)
- FlipWiFi: Improve error handling, update scan loading and parsing, many bug/crash fixes, max 100 network scan, add some fast commands (by @jblanked), add connectivity check on startup (by @jamisonderek)
- KeyCopier: Support for formats AR4, M1, AM7, Y2, Y11, S22, NA25, CO88, LW4, LW5, NA12, RU45, H75, B102, Y159, KA14, YM63, SFIC, RV (by @HonestLocksmith)
- NFC Maker: Allow setting custom UID, code cleanup (by @Willy-JL), show extra symbols for WiFi SSID/Password and Emails (by @956MB)
- Nightstand: Show battery percentage and show AM/PM in timer mode (by @956MB)
- Oscilloscope: Add simple spectrum analyser and basic software scaling support (by @anfractuosity)
- Picopass: Handle write key retry when a different card is presented, save SR as legacy from saved menu (by @bettse)
- Pokemon Trade Tool: Update to gblink v0.63 which includes saving/loading of pin configurations for the EXT link interface, bug fixes (by @kbembedded)
- Snake 2.0: Progress saving, endless mode, game timer, fruit positioning bugfixes (by @Willzvul)
- uPython: Enabled extra functions for the `random` module, optimized speaker note constants to save space (by @ofabel)
- WebCrawler: New BROWSE option to read HTML pages, many bugfixes (by @jblanked), improved progress display, added connectivity check on startup (by @jamisonderek)
- WiFi Marauder: AirTag Spoof, flipper blespam, sniff airtag and flipper, list airtag (by @0xchocolate)
- UL: NFC Magic: Added possibility to write 7b MFC to Gen1 tags (by @mishamyte)
- UL: Unitemp: Fixed handling of hPa units (by @shininghero)
- UL: Fixed apps for firmware USB CDC callback changes (by @xMasterX)
- Infrared: Update audio, bluray and tv universal remotes (#348 #358 by @jaylikesbunda)
- NFC:
- OFW: Replace mf_classic_dict.nfc with Proxmark3 version (by @onovy)
- OFW: More station IDs for Clipper plugin (by @ted-logan)
- OFW: Infrared: Add IR command for NAD DR2 D7050 D3020 (by @nikos9742)

### Fixed:
- Nothing
- Desktop: Fixed Wardriving animation design (by @Davim09)
- Main Menu: Fix MNTM style battery percent off by 1 (#339 by @956MB)
- OFW: Fix lost BadBLE keystrokes (by @Astrrra)
- OFW: GPIO: Fix USB UART Bridge Crash by increasing system stack size (by @Astrrra)
- OFW: Loader: Fix BusFault in handling of OOM (by @Willy-JL)
- NFC:
- XERO: Fix issue with MFC key recovery state machine performing key reuse early (by @noproto)
- OFW: Plantain parser Last payment amount fix (by @mxcdoam)
- OFW: Fix skylander ID reading (by @bettse)
- OFW: Fix MIFARE Plus detection (by @GMMan)
- OFW: Fix ISO15693 stuck in wrong mode (by @RebornedBrain)
- OFW: Fix MFUL PWD_AUTH command creation when 0x00 in password (by @GMMan)
- OFW: Fix typo for `mf_classic_key_cahce_get_next_key()` function (by @luu176)
- OFW: U2F: Fix message digest memory leak (by @GMMan)
- OFW: JS: SDK workaround incorrect serial port handling by OS (by @portasynthinca3)
- OFW: FBT: Fix invalid path errors on Windows with UTF8 paths (by @Alex4386)

### Removed:
- Nothing
- NFC: Previous fix for ISO15693 stuck in wrong mode (#225)
- Removes APIs `nfc_iso15693_detect_mode()`, `nfc_iso15693_force_1outof4()`, `nfc_iso15693_force_1outof256()`
6 changes: 4 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,9 @@ firmware_env.Append(
IMG_LINT_SOURCES=[
# Image assets
"applications",
"!applications/external",
"assets",
# Avoid merge conflicts
"!applications/external",
],
)

Expand All @@ -346,8 +347,9 @@ black_commandline = [
black_base_args = [
"--include",
'"(\\.scons|\\.py|SConscript|SConstruct|\\.fam)$"',
# Avoid merge conflicts
"--exclude",
'"(mp_flipper/flipperzero/random\\.py)$"',
'"applications/external"',
]

distenv.PhonyTarget(
Expand Down
8 changes: 8 additions & 0 deletions applications/debug/unit_tests/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,11 @@ App(
entry_point="get_api",
requires=["unit_tests"],
)

App(
appid="test_pipe",
sources=["tests/common/*.c", "tests/pipe/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ static bool test_write(const char* file_name) {
if(!flipper_format_file_open_always(file, file_name)) break;
if(!flipper_format_write_header_cstr(file, test_filetype, test_version)) break;
if(!flipper_format_write_comment_cstr(file, "This is comment")) break;
if(!flipper_format_write_empty_line(file)) break;
if(!flipper_format_write_string_cstr(file, test_string_key, test_string_data)) break;
if(!flipper_format_write_int32(file, test_int_key, test_int_data, COUNT_OF(test_int_data)))
break;
Expand Down
108 changes: 108 additions & 0 deletions applications/debug/unit_tests/tests/furi/furi_stdio_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#include <furi.h>
#include <errno.h>
#include <stdio.h>
#include "../test.h" // IWYU pragma: keep

#define TAG "StdioTest"

#define CONTEXT_MAGIC ((void*)0xDEADBEEF)

// stdin

static char mock_in[256];
static size_t mock_in_len, mock_in_pos;

static void set_mock_in(const char* str) {
size_t len = strlen(str);
strcpy(mock_in, str);
mock_in_len = len;
mock_in_pos = 0;
}

static size_t mock_in_cb(char* buffer, size_t size, FuriWait wait, void* context) {
UNUSED(wait);
furi_check(context == CONTEXT_MAGIC);
size_t remaining = mock_in_len - mock_in_pos;
size = MIN(remaining, size);
memcpy(buffer, mock_in + mock_in_pos, size);
mock_in_pos += size;
return size;
}

void test_stdin(void) {
FuriThreadStdinReadCallback in_cb = furi_thread_get_stdin_callback();
furi_thread_set_stdin_callback(mock_in_cb, CONTEXT_MAGIC);
char buf[256];

// plain in
set_mock_in("Hello, World!\n");
fgets(buf, sizeof(buf), stdin);
mu_assert_string_eq("Hello, World!\n", buf);
mu_assert_int_eq(EOF, getchar());

// ungetc
ungetc('i', stdin);
ungetc('H', stdin);
fgets(buf, sizeof(buf), stdin);
mu_assert_string_eq("Hi", buf);
mu_assert_int_eq(EOF, getchar());

// ungetc + plain in
set_mock_in(" World");
ungetc('i', stdin);
ungetc('H', stdin);
fgets(buf, sizeof(buf), stdin);
mu_assert_string_eq("Hi World", buf);
mu_assert_int_eq(EOF, getchar());

// partial plain in
set_mock_in("Hello, World!\n");
fgets(buf, strlen("Hello") + 1, stdin);
mu_assert_string_eq("Hello", buf);
mu_assert_int_eq(',', getchar());
fgets(buf, sizeof(buf), stdin);
mu_assert_string_eq(" World!\n", buf);

furi_thread_set_stdin_callback(in_cb, CONTEXT_MAGIC);
}

// stdout

static FuriString* mock_out;
FuriThreadStdoutWriteCallback original_out_cb;

static void mock_out_cb(const char* data, size_t size, void* context) {
furi_check(context == CONTEXT_MAGIC);
// there's no furi_string_cat_strn :(
for(size_t i = 0; i < size; i++) {
furi_string_push_back(mock_out, data[i]);
}
}

static void assert_and_clear_mock_out(const char* expected) {
// return the original stdout callback for the duration of the check
// if the check fails, we don't want the error to end up in our buffer,
// we want to be able to see it!
furi_thread_set_stdout_callback(original_out_cb, CONTEXT_MAGIC);
mu_assert_string_eq(expected, furi_string_get_cstr(mock_out));
furi_thread_set_stdout_callback(mock_out_cb, CONTEXT_MAGIC);

furi_string_reset(mock_out);
}

void test_stdout(void) {
original_out_cb = furi_thread_get_stdout_callback();
furi_thread_set_stdout_callback(mock_out_cb, CONTEXT_MAGIC);
mock_out = furi_string_alloc();

puts("Hello, World!");
assert_and_clear_mock_out("Hello, World!\n");

printf("He");
printf("llo!");
fflush(stdout);
assert_and_clear_mock_out("Hello!");

furi_string_free(mock_out);
furi_thread_set_stdout_callback(original_out_cb, CONTEXT_MAGIC);
}
8 changes: 8 additions & 0 deletions applications/debug/unit_tests/tests/furi/furi_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ void test_furi_memmgr(void);
void test_furi_event_loop(void);
void test_errno_saving(void);
void test_furi_primitives(void);
void test_stdin(void);
void test_stdout(void);

static int foo = 0;

Expand Down Expand Up @@ -52,6 +54,11 @@ MU_TEST(mu_test_furi_primitives) {
test_furi_primitives();
}

MU_TEST(mu_test_stdio) {
test_stdin();
test_stdout();
}

MU_TEST_SUITE(test_suite) {
MU_SUITE_CONFIGURE(&test_setup, &test_teardown);
MU_RUN_TEST(test_check);
Expand All @@ -61,6 +68,7 @@ MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(mu_test_furi_pubsub);
MU_RUN_TEST(mu_test_furi_memmgr);
MU_RUN_TEST(mu_test_furi_event_loop);
MU_RUN_TEST(mu_test_stdio);
MU_RUN_TEST(mu_test_errno_saving);
MU_RUN_TEST(mu_test_furi_primitives);
}
Expand Down
Loading

0 comments on commit a386537

Please sign in to comment.